evennia.web.admin.accounts

class evennia.web.admin.accounts.AccountChangeForm(*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.

__init__(*args, **kwargs)[source]

Tweak some fields dynamically.

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.ChoiceField 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 = {'db_cmdset_storage': <django.forms.fields.CharField object>, 'db_lock_storage': <django.forms.fields.CharField object>, 'db_typeclass_path': <django.forms.fields.ChoiceField object>, 'is_superuser': <django.forms.fields.BooleanField object>, '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.web.admin.accounts.AccountCreationForm(*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.web.admin.accounts.AccountTagInline(parent_model, admin_site)[source]

Bases: evennia.web.admin.tags.TagInline

Inline Account Tags.

model

alias of evennia.accounts.models.AccountDB_db_tags

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

Bases: evennia.web.admin.attributes.AttributeInline

Inline Account Attributes.

model

alias of evennia.accounts.models.AccountDB_db_attributes

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

Bases: django.contrib.admin.options.StackedInline

Inline creation of puppet-Object in Account.

class ObjectCreateForm(*args, **kwargs)

Bases: django.forms.models.ModelForm

This form details the look of the fields.

class Meta

Bases: object

fields = '__all__'
model

alias of evennia.objects.models.ObjectDB

__init__(*args, **kwargs)

Tweak some fields dynamically.

base_fields = {'db_account': <django.forms.models.ModelChoiceField object>, 'db_attributes': <django.forms.models.ModelMultipleChoiceField object>, 'db_cmdset_storage': <django.forms.fields.CharField object>, 'db_destination': <django.forms.models.ModelChoiceField object>, 'db_home': <django.forms.models.ModelChoiceField object>, 'db_key': <django.forms.fields.CharField object>, 'db_location': <django.forms.models.ModelChoiceField object>, 'db_lock_storage': <django.forms.fields.CharField object>, 'db_sessid': <django.forms.fields.CharField object>, 'db_tags': <django.forms.models.ModelMultipleChoiceField object>, 'db_typeclass_path': <django.forms.fields.ChoiceField object>}
declared_fields = {'db_cmdset_storage': <django.forms.fields.CharField object>, 'db_destination': <django.forms.models.ModelChoiceField object>, 'db_home': <django.forms.models.ModelChoiceField object>, 'db_key': <django.forms.fields.CharField object>, 'db_location': <django.forms.models.ModelChoiceField object>, 'db_lock_storage': <django.forms.fields.CharField object>, 'db_typeclass_path': <django.forms.fields.ChoiceField object>}
property media

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

verbose_name = 'Puppeted Object'
model

alias of evennia.objects.models.ObjectDB

view_on_site = False
form

alias of evennia.web.admin.objects.ObjectCreateForm

fieldsets = ((None, {'fields': (('db_key', 'db_typeclass_path'), ('db_location', 'db_home', 'db_destination'), 'db_cmdset_storage', 'db_lock_storage'), 'description': 'Object currently puppeted by the account (note that this will go away if account logs out or unpuppets)'}),)
extra = 0
readonly_fields = ('db_key', 'db_typeclass_path', 'db_destination', 'db_location', 'db_home', 'db_account', 'db_cmdset_storage', 'db_lock_storage')
has_add_permission(request, obj=None)[source]

Return True if the given request has permission to add an object. Can be overridden by the user in subclasses.

has_delete_permission(request, obj=None)[source]

Return True if the given request has permission to delete the given Django model instance, the default implementation doesn’t examine the obj parameter.

Can be overridden by the user in subclasses. In such case it should return True if the given request has permission to delete the obj model instance. If obj is None, this should return True if the given request has permission to delete any object of the given type.

property media
class evennia.web.admin.accounts.AccountAdmin(model, admin_site)[source]

Bases: django.contrib.auth.admin.UserAdmin

This is the main creation screen for Users/accounts

list_display = ('id', 'username', 'is_staff', 'is_superuser', 'db_typeclass_path', 'db_date_created')
form

alias of AccountChangeForm

add_form

alias of AccountCreationForm

search_fields = ['=id', '^username', 'db_typeclass_path']
ordering = ['-db_date_created', 'id']
list_filter = ['is_superuser', 'is_staff', 'db_typeclass_path']
inlines = [<class 'evennia.web.admin.accounts.AccountTagInline'>, <class 'evennia.web.admin.accounts.AccountAttributeInline'>]
readonly_fields = ['db_date_created', 'serialized_string', 'puppeted_objects']
view_on_site = False
fieldsets = ((None, {'fields': (('username', 'db_typeclass_path'), 'password', 'email', 'db_date_created', 'db_lock_storage', 'db_cmdset_storage', 'puppeted_objects', 'serialized_string')}), ('Admin/Website properties', {'fields': (('first_name', 'last_name'), 'last_login', 'date_joined', 'is_active', 'is_staff', 'is_superuser', 'user_permissions', 'groups'), 'description': '<i>Used by the website/Django admin. Except for `superuser status`, the permissions are not used in-game.</i>'}))
add_fieldsets = ((None, {'fields': ('username', 'password1', 'password2', 'email'), 'description': '<i>These account details are shared by the admin system and the game.</i>'}),)
serialized_string(obj)[source]

Get the serialized version of the object.

puppeted_objects(obj)[source]

Get any currently puppeted objects (read only list)

get_form(request, obj=None, **kwargs)[source]

Overrides help texts.

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