evennia.accounts.admin

class evennia.accounts.admin.AccountDBChangeForm(*args, **kwargs)[source]

Bases: django.contrib.auth.forms.UserChangeForm

Modify the accountdb class.

class Meta[source]

Bases: object

model

alias of evennia.accounts.models.AccountDB

fields = '__all__'
clean_username()[source]

Clean the username and check its existence.

base_fields = {'date_joined': <django.forms.fields.DateTimeField object>, 'db_attributes': <django.forms.models.ModelMultipleChoiceField object>, 'db_cmdset_storage': <django.forms.fields.CharField object>, 'db_is_bot': <django.forms.fields.BooleanField object>, 'db_is_connected': <django.forms.fields.BooleanField object>, 'db_key': <django.forms.fields.CharField object>, 'db_lock_storage': <django.forms.fields.CharField object>, 'db_tags': <django.forms.models.ModelMultipleChoiceField object>, 'db_typeclass_path': <django.forms.fields.CharField object>, 'email': <django.forms.fields.EmailField object>, 'first_name': <django.forms.fields.CharField object>, 'groups': <django.forms.models.ModelMultipleChoiceField object>, 'is_active': <django.forms.fields.BooleanField object>, 'is_staff': <django.forms.fields.BooleanField object>, 'is_superuser': <django.forms.fields.BooleanField object>, 'last_login': <django.forms.fields.DateTimeField object>, 'last_name': <django.forms.fields.CharField object>, 'password': <django.contrib.auth.forms.ReadOnlyPasswordHashField object>, 'user_permissions': <django.forms.models.ModelMultipleChoiceField object>, 'username': <django.forms.fields.RegexField object>}
declared_fields = {'password': <django.contrib.auth.forms.ReadOnlyPasswordHashField object>, 'username': <django.forms.fields.RegexField object>}
property media

Return all media required to render the widgets on this form.

class evennia.accounts.admin.AccountDBCreationForm(*args, **kwargs)[source]

Bases: django.contrib.auth.forms.UserCreationForm

Create a new AccountDB instance.

class Meta[source]

Bases: object

model

alias of evennia.accounts.models.AccountDB

fields = '__all__'
clean_username()[source]

Cleanup username.

base_fields = {'date_joined': <django.forms.fields.DateTimeField object>, 'db_attributes': <django.forms.models.ModelMultipleChoiceField object>, 'db_cmdset_storage': <django.forms.fields.CharField object>, 'db_is_bot': <django.forms.fields.BooleanField object>, 'db_is_connected': <django.forms.fields.BooleanField object>, 'db_key': <django.forms.fields.CharField object>, 'db_lock_storage': <django.forms.fields.CharField object>, 'db_tags': <django.forms.models.ModelMultipleChoiceField object>, 'db_typeclass_path': <django.forms.fields.CharField object>, 'email': <django.forms.fields.EmailField object>, 'first_name': <django.forms.fields.CharField object>, 'groups': <django.forms.models.ModelMultipleChoiceField object>, 'is_active': <django.forms.fields.BooleanField object>, 'is_staff': <django.forms.fields.BooleanField object>, 'is_superuser': <django.forms.fields.BooleanField object>, 'last_login': <django.forms.fields.DateTimeField object>, 'last_name': <django.forms.fields.CharField object>, 'password': <django.forms.fields.CharField object>, 'password1': <django.forms.fields.CharField object>, 'password2': <django.forms.fields.CharField object>, 'user_permissions': <django.forms.models.ModelMultipleChoiceField object>, 'username': <django.forms.fields.RegexField object>}
declared_fields = {'password1': <django.forms.fields.CharField object>, 'password2': <django.forms.fields.CharField object>, 'username': <django.forms.fields.RegexField object>}
property media

Return all media required to render the widgets on this form.

class evennia.accounts.admin.AccountForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, instance=None, use_required_attribute=None, renderer=None)[source]

Bases: django.forms.models.ModelForm

Defines how to display Accounts

class Meta[source]

Bases: object

model

alias of evennia.accounts.models.AccountDB

fields = '__all__'
app_label = 'accounts'
base_fields = {'date_joined': <django.forms.fields.DateTimeField object>, 'db_attributes': <django.forms.models.ModelMultipleChoiceField object>, 'db_cmdset_storage': <django.forms.fields.CharField object>, 'db_is_bot': <django.forms.fields.BooleanField object>, 'db_is_connected': <django.forms.fields.BooleanField object>, 'db_key': <django.forms.fields.RegexField object>, 'db_lock_storage': <django.forms.fields.CharField object>, 'db_permissions': <django.forms.fields.CharField object>, 'db_tags': <django.forms.models.ModelMultipleChoiceField object>, 'db_typeclass_path': <django.forms.fields.CharField object>, 'email': <django.forms.fields.EmailField object>, 'first_name': <django.forms.fields.CharField object>, 'groups': <django.forms.models.ModelMultipleChoiceField object>, 'is_active': <django.forms.fields.BooleanField object>, 'is_staff': <django.forms.fields.BooleanField object>, 'is_superuser': <django.forms.fields.BooleanField object>, 'last_login': <django.forms.fields.DateTimeField object>, 'last_name': <django.forms.fields.CharField object>, 'password': <django.forms.fields.CharField object>, 'user_permissions': <django.forms.models.ModelMultipleChoiceField object>, 'username': <django.forms.fields.CharField object>}
declared_fields = {'db_cmdset_storage': <django.forms.fields.CharField object>, 'db_key': <django.forms.fields.RegexField object>, 'db_lock_storage': <django.forms.fields.CharField object>, 'db_permissions': <django.forms.fields.CharField object>, 'db_typeclass_path': <django.forms.fields.CharField object>}
property media

Return all media required to render the widgets on this form.

class evennia.accounts.admin.AccountInline(parent_model, admin_site)[source]

Bases: django.contrib.admin.options.StackedInline

Inline creation of Account

model

alias of evennia.accounts.models.AccountDB

template = 'admin/accounts/stacked.html'
form

alias of AccountForm

fieldsets = (('In-game Permissions and Locks', {'fields': ('db_lock_storage',), 'description': '<i>These are permissions/locks for in-game use. They are unrelated to website access rights.</i>'}), ('In-game Account data', {'fields': ('db_typeclass_path', 'db_cmdset_storage'), 'description': '<i>These fields define in-game-specific properties for the Account object in-game.</i>'}))
extra = 1
max_num = 1
property media
class evennia.accounts.admin.AccountTagInline(parent_model, admin_site)[source]

Bases: evennia.typeclasses.admin.TagInline

Inline Account Tags.

model

alias of evennia.accounts.models.AccountDB_db_tags

related_field = 'accountdb'
property media
class evennia.accounts.admin.AccountAttributeInline(parent_model, admin_site)[source]

Bases: evennia.typeclasses.admin.AttributeInline

Inline Account Attributes.

model

alias of evennia.accounts.models.AccountDB_db_attributes

related_field = 'accountdb'
property media
class evennia.accounts.admin.AccountDBAdmin(model, admin_site)[source]

Bases: django.contrib.auth.admin.UserAdmin

This is the main creation screen for Users/accounts

list_display = ('username', 'email', 'is_staff', 'is_superuser')
form

alias of AccountDBChangeForm

add_form

alias of AccountDBCreationForm

inlines = [<class 'evennia.accounts.admin.AccountTagInline'>, <class 'evennia.accounts.admin.AccountAttributeInline'>]
fieldsets = ((None, {'fields': ('username', 'password', 'email')}), ('Website profile', {'fields': ('first_name', 'last_name'), 'description': '<i>These are not used in the default system.</i>'}), ('Website dates', {'fields': ('last_login', 'date_joined'), 'description': '<i>Relevant only to the website.</i>'}), ('Website Permissions', {'fields': ('is_active', 'is_staff', 'is_superuser', 'user_permissions', 'groups'), 'description': '<i>These are permissions/permission groups for accessing the admin site. They are unrelated to in-game access rights.</i>'}), ('Game Options', {'fields': ('db_typeclass_path', 'db_cmdset_storage', 'db_lock_storage'), 'description': '<i>These are attributes that are more relevant to gameplay.</i>'}))
add_fieldsets = ((None, {'fields': ('username', 'password1', 'password2', 'email'), 'description': '<i>These account details are shared by the admin system and the game.</i>'}),)
user_change_password(request, id, form_url='')[source]
save_model(request, obj, form, change)[source]

Custom save actions.

Parameters
  • request (Request) – Incoming request.

  • obj (Object) – Object to save.

  • form (Form) – Related form instance.

  • change (bool) – False if this is a new save and not an update.

response_add(request, obj, post_url_continue=None)[source]

Determine the HttpResponse for the add_view stage. It mostly defers to its superclass implementation but is customized because the User model has a slightly different workflow.

property media