evennia.web.admin.objects

class evennia.web.admin.objects.ObjectAttributeInline(parent_model, admin_site)[source]

Bases: evennia.web.admin.attributes.AttributeInline

Defines inline descriptions of Attributes (experimental)

model

alias of evennia.objects.models.ObjectDB_db_attributes

related_field = 'objectdb'
property media
class evennia.web.admin.objects.ObjectTagInline(parent_model, admin_site)[source]

Bases: evennia.web.admin.tags.TagInline

Defines inline descriptions of Tags (experimental)

model

alias of evennia.objects.models.ObjectDB_db_tags

related_field = 'objectdb'
property media
class evennia.web.admin.objects.ObjectCreateForm(*args, **kwargs)[source]

Bases: django.forms.models.ModelForm

This form details the look of the fields.

class Meta[source]

Bases: object

model

alias of evennia.objects.models.ObjectDB

fields = '__all__'
__init__(*args, **kwargs)[source]

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.

class evennia.web.admin.objects.ObjectEditForm(*args, **kwargs)[source]

Bases: evennia.web.admin.objects.ObjectCreateForm

Form used for editing. Extends the create one with more fields

class Meta[source]

Bases: object

model

alias of evennia.objects.models.ObjectDB

fields = '__all__'
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_account': <django.forms.models.ModelChoiceField 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_typeclass_path': <django.forms.fields.ChoiceField object>}
property media

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

class evennia.web.admin.objects.ObjectAdmin(model, admin_site)[source]

Bases: django.contrib.admin.options.ModelAdmin

Describes the admin page for Objects.

inlines = [<class 'evennia.web.admin.objects.ObjectTagInline'>, <class 'evennia.web.admin.objects.ObjectAttributeInline'>]
list_display = ('id', 'db_key', 'db_typeclass_path', 'db_location', 'db_destination', 'db_account', 'db_date_created')
ordering = ['-db_date_created', '-id']
search_fields = ['=id', '^db_key', 'db_typeclass_path', '^db_account__db_key', '^db_location__db_key']
raw_id_fields = ('db_destination', 'db_location', 'db_home', 'db_account')
readonly_fields = ('serialized_string', 'link_button')
save_as = True
save_on_top = True
view_on_site = False
list_filter = ('db_typeclass_path',)
form

alias of ObjectEditForm

fieldsets = ((None, {'fields': (('db_key', 'db_typeclass_path'), ('db_location', 'db_home', 'db_destination'), ('db_account', 'link_button'), 'db_cmdset_storage', 'db_lock_storage', 'serialized_string')}),)
add_form

alias of ObjectCreateForm

add_fieldsets = ((None, {'fields': (('db_key', 'db_typeclass_path'), ('db_location', 'db_home', 'db_destination'), 'db_cmdset_storage')}),)
serialized_string(obj)[source]

Get the serialized version of the object.

get_fieldsets(request, obj=None)[source]

Return fieldsets.

Parameters
  • request (Request) – Incoming request.

  • obj (Object, optional) – Database object.

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

Use special form during creation.

Parameters
  • request (Request) – Incoming request.

  • obj (Object, optional) – Database object.

get_urls()[source]

Link object and account when pressing the button.

This will:

  • Set account.db._last_puppet to this object

  • Add object to account.characters

  • Change object locks to allow puppeting by account

save_model(request, obj, form, change)[source]

Model-save hook.

Parameters
  • request (Request) – Incoming request.

  • obj (Object) – Database object.

  • form (Form) – Form instance.

  • change (bool) – If this is a change or a new object.

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

Determine the HttpResponse for the add_view stage.

property media