From f66db3344d6c6832ccd37357fdbfe93064a7312d Mon Sep 17 00:00:00 2001 From: Griatch Date: Sat, 4 Mar 2023 20:10:12 +0100 Subject: [PATCH] Update djangodoc references also in READMEs, as per #3126 --- docs/source/Contribs/Contrib-AWSStorage.md | 2 +- docs/source/Setup/Settings-Default.md | 6 +++--- .../contrib/base_systems/awsstorage/README.md | 2 +- evennia/game_template/web/admin/README.md | 4 ++-- evennia/game_template/web/webclient/README.md | 6 +++--- evennia/game_template/web/website/README.md | 8 ++++---- evennia/server/signals.py | 20 +++++++------------ evennia/settings_default.py | 6 +++--- evennia/utils/idmapper/README_orig.rst | 2 +- evennia/web/website/forms.py | 7 +++---- 10 files changed, 28 insertions(+), 35 deletions(-) diff --git a/docs/source/Contribs/Contrib-AWSStorage.md b/docs/source/Contribs/Contrib-AWSStorage.md index cca8246f37..9ad4a6d759 100644 --- a/docs/source/Contribs/Contrib-AWSStorage.md +++ b/docs/source/Contribs/Contrib-AWSStorage.md @@ -41,7 +41,7 @@ image uploaded by a user), the save (or load) communication follows the path: Django -> Storage backend Storage backend -> file storage location (e.g. hard drive) -[django docs](https://docs.djangoproject.com/en/3.0/ref/settings/#std:setting-STATICFILES_STORAGE) +[django docs](https://docs.djangoproject.com/en/4.1/ref/settings/#std:setting-STATICFILES_STORAGE) This plugin, when enabled, overrides the default storage backend, which defaults to saving files at mygame/website/, instead, diff --git a/docs/source/Setup/Settings-Default.md b/docs/source/Setup/Settings-Default.md index d7e86cc2bb..c85961734a 100644 --- a/docs/source/Setup/Settings-Default.md +++ b/docs/source/Setup/Settings-Default.md @@ -54,7 +54,7 @@ SERVER_HOSTNAME = "localhost" # and only allow connections from localhost. Requires a cold reboot. LOCKDOWN_MODE = False # Controls whether new account registration is available. -# Set to False to lock down the registration page and the create account command. +# Set to False to lock down the registration page and the create account command. NEW_ACCOUNT_REGISTRATION_ENABLED = True # Activate telnet service TELNET_ENABLED = True @@ -1017,7 +1017,7 @@ TEMPLATES = [ } ] # Django cache settings -# https://docs.djangoproject.com/en/dev/topics/cache/#setting-up-the-cache +# https://docs.djangoproject.com/en/4.1/topics/cache/#setting-up-the-cache CACHES = { "default": { "BACKEND": "django.core.cache.backends.locmem.LocMemCache", @@ -1076,7 +1076,7 @@ INSTALLED_APPS = [ AUTH_USER_MODEL = "accounts.AccountDB" # Password validation plugins -# https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators +# https://docs.djangoproject.com/en/4.1/ref/settings/#auth-password-validators AUTH_PASSWORD_VALIDATORS = [ {"NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator"}, { diff --git a/evennia/contrib/base_systems/awsstorage/README.md b/evennia/contrib/base_systems/awsstorage/README.md index fceff49d12..4d5c9f8796 100644 --- a/evennia/contrib/base_systems/awsstorage/README.md +++ b/evennia/contrib/base_systems/awsstorage/README.md @@ -41,7 +41,7 @@ image uploaded by a user), the save (or load) communication follows the path: Django -> Storage backend Storage backend -> file storage location (e.g. hard drive) -[django docs](https://docs.djangoproject.com/en/3.0/ref/settings/#std:setting-STATICFILES_STORAGE) +[django docs](https://docs.djangoproject.com/en/4.1/ref/settings/#std:setting-STATICFILES_STORAGE) This plugin, when enabled, overrides the default storage backend, which defaults to saving files at mygame/website/, instead, diff --git a/evennia/game_template/web/admin/README.md b/evennia/game_template/web/admin/README.md index d426d2d523..e5d8b53f3e 100644 --- a/evennia/game_template/web/admin/README.md +++ b/evennia/game_template/web/admin/README.md @@ -1,5 +1,5 @@ # Admin views Evennia makes several customizations to the Django web admin, but you can make -further changes here. Customizing the admin is a big topic and -you are best off reading more about it in the [Django admin site documentation](https://docs.djangoproject.com/en/3.2/ref/contrib/admin/). +further changes here. Customizing the admin is a big topic and +you are best off reading more about it in the [Django admin site documentation](https://docs.djangoproject.com/en/4.1/ref/contrib/admin/). diff --git a/evennia/game_template/web/webclient/README.md b/evennia/game_template/web/webclient/README.md index ebf9b983b9..b20aa62d88 100644 --- a/evennia/game_template/web/webclient/README.md +++ b/evennia/game_template/web/webclient/README.md @@ -1,9 +1,9 @@ -# Webclient Views +# Webclient Views The webclient is mainly controlled by Javascript directly in the browser, so you usually customize it via `mygame/web/static/webclient/js/` - files instead. -There is very little you can change from here, unless you want to implement +There is very little you can change from here, unless you want to implement your very own client from scratch. ## On views @@ -19,5 +19,5 @@ responsible (usually) for producing the web page by filling in a _template_ - a HTML document that can have special tags in it that are replaced for dynamic content. It then returns the finished HTML page for the user to view. -See the [Django docs on Views](https://docs.djangoproject.com/en/3.2/topics/http/views/) for +See the [Django docs on Views](https://docs.djangoproject.com/en/4.1/topics/http/views/) for more information. diff --git a/evennia/game_template/web/website/README.md b/evennia/game_template/web/website/README.md index ae417d9f30..1bbd5de721 100644 --- a/evennia/game_template/web/website/README.md +++ b/evennia/game_template/web/website/README.md @@ -1,4 +1,4 @@ -# Website views and other code +# Website views and other code A 'view' is python code (a function or callable class) responsible for producing a HTML page for a user to view in response for going to a given URL @@ -11,14 +11,14 @@ responsible (usually) for producing the web page by filling in a _template_ - a HTML document that can have special tags in it that are replaced for dynamic content. It then returns the finished HTML page for the user to view. -See the [Django docs on Views](https://docs.djangoproject.com/en/3.2/topics/http/views/) for +See the [Django docs on Views](https://docs.djangoproject.com/en/4.1/topics/http/views/) for more information. ## Overriding a view -1. Copy the original code you want to change from `evennia/web/website/views/` into +1. Copy the original code you want to change from `evennia/web/website/views/` into `mygame/web/website/views/` and edit it as you like. -2. Look at `evennia/web/website/urls.py` and find the regex pointing to the view. Add this regex +2. Look at `evennia/web/website/urls.py` and find the regex pointing to the view. Add this regex to your own `mygam/website/urls.pye` but change it to import and point to your changed version instead. 3. Reload the server and the page now uses your version of the view. diff --git a/evennia/server/signals.py b/evennia/server/signals.py index 728825a7df..bb87d62f6b 100644 --- a/evennia/server/signals.py +++ b/evennia/server/signals.py @@ -91,13 +91,13 @@ SIGNAL_CHANNEL_POST_CREATE = Signal() # Called just after at_traverse hook. SIGNAL_EXIT_TRAVERSED = Signal() -# Django default signals (https://docs.djangoproject.com/en/2.2/topics/signals/) +# Django default signals (https://docs.djangoproject.com/en/4.1/topics/signals/) from django.core.signals import request_finished # " ends. from django.core.signals import request_started # Sent when HTTP request begins. -from django.db.backends.signals import ( # Sent when making initial connection to database +from django.db.backends.signals import ( connection_created, -) +) # Sent when making initial connection to database from django.db.models.signals import m2m_changed # Sent when a ManyToManyField changes. from django.db.models.signals import post_delete # after " from django.db.models.signals import post_init # end @@ -105,15 +105,9 @@ from django.db.models.signals import post_migrate # after " from django.db.models.signals import post_save # after " from django.db.models.signals import pre_delete # Sent before an object is deleted. from django.db.models.signals import pre_migrate # Sent before migration starts +from django.db.models.signals import pre_save # Sent before a typeclass' .save is called. from django.db.models.signals import ( - pre_save, # Sent before a typeclass' .save is called. -) -from django.db.models.signals import ( # Sent at start of typeclass __init__ (before at_init) pre_init, -) -from django.test.signals import ( - setting_changed, # Sent when setting changes from override -) -from django.test.signals import ( - template_rendered, # Sent when test system renders template -) +) # Sent at start of typeclass __init__ (before at_init) +from django.test.signals import setting_changed # Sent when setting changes from override +from django.test.signals import template_rendered # Sent when test system renders template diff --git a/evennia/settings_default.py b/evennia/settings_default.py index 01ea956036..c27b9d6034 100644 --- a/evennia/settings_default.py +++ b/evennia/settings_default.py @@ -35,7 +35,7 @@ SERVER_HOSTNAME = "localhost" # and only allow connections from localhost. Requires a cold reboot. LOCKDOWN_MODE = False # Controls whether new account registration is available. -# Set to False to lock down the registration page and the create account command. +# Set to False to lock down the registration page and the create account command. NEW_ACCOUNT_REGISTRATION_ENABLED = True # Activate telnet service TELNET_ENABLED = True @@ -998,7 +998,7 @@ TEMPLATES = [ } ] # Django cache settings -# https://docs.djangoproject.com/en/dev/topics/cache/#setting-up-the-cache +# https://docs.djangoproject.com/en/4.1/topics/cache/#setting-up-the-cache CACHES = { "default": { "BACKEND": "django.core.cache.backends.locmem.LocMemCache", @@ -1057,7 +1057,7 @@ INSTALLED_APPS = [ AUTH_USER_MODEL = "accounts.AccountDB" # Password validation plugins -# https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators +# https://docs.djangoproject.com/en/4.1/ref/settings/#auth-password-validators AUTH_PASSWORD_VALIDATORS = [ {"NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator"}, { diff --git a/evennia/utils/idmapper/README_orig.rst b/evennia/utils/idmapper/README_orig.rst index 43ec578d5d..1384d52821 100644 --- a/evennia/utils/idmapper/README_orig.rst +++ b/evennia/utils/idmapper/README_orig.rst @@ -2,7 +2,7 @@ This fork of django-idmapper fixes some bugs that prevented the idmapper from being used in many instances. In particular, the caching manager is now inherited by SharedMemoryManager subclasses, and it is used when Django uses an automatic manager (see -http://docs.djangoproject.com/en/dev/topics/db/managers/#controlling-automatic-manager-types). +http://docs.djangoproject.com/en/4.1/topics/db/managers/#controlling-automatic-manager-types). This means access through foreign keys now uses identity mapping. Tested with Django version 1.2 alpha 1 SVN-12375. diff --git a/evennia/web/website/forms.py b/evennia/web/website/forms.py index 8f6a779197..bec84a0734 100644 --- a/evennia/web/website/forms.py +++ b/evennia/web/website/forms.py @@ -3,7 +3,6 @@ from django.conf import settings from django.contrib.auth.forms import UserCreationForm, UsernameField from django.forms import ModelForm from django.utils.html import escape - from evennia.utils import class_from_module @@ -127,13 +126,13 @@ class CharacterForm(ObjectForm): this is used for the 'desc' field to show a Textarea box instead of a Textbox. For help in building out your form, please see: - https://docs.djangoproject.com/en/1.11/topics/forms/#building-a-form-in-django + https://docs.djangoproject.com/en/4.1/topics/forms/#building-a-form-in-django For more information on fields and their capabilities, see: - https://docs.djangoproject.com/en/1.11/ref/forms/fields/ + https://docs.djangoproject.com/en/4.1/ref/forms/fields/ For more on widgets, see: - https://docs.djangoproject.com/en/1.11/ref/forms/widgets/ + https://docs.djangoproject.com/en/4.1/ref/forms/widgets/ """