evennia.web.admin.comms

This defines how Comm models are displayed in the web admin interface.

class evennia.web.admin.comms.MsgTagInline(parent_model, admin_site)[source]

Bases: evennia.web.admin.tags.TagInline

Inline display for Msg-tags.

model

alias of evennia.comms.models.Msg_db_tags

related_field = 'msg'
property media
class evennia.web.admin.comms.MsgForm(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

Custom Msg form.

class Meta[source]

Bases: object

models

alias of evennia.comms.models.Msg

fields = '__all__'
base_fields = {'db_header': <django.forms.fields.CharField object>, 'db_lock_storage': <django.forms.fields.CharField object>}
declared_fields = {'db_header': <django.forms.fields.CharField object>, 'db_lock_storage': <django.forms.fields.CharField object>}
property media

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

class evennia.web.admin.comms.MsgAdmin(model, admin_site)[source]

Bases: django.contrib.admin.options.ModelAdmin

Defines display for Msg objects

inlines = [<class 'evennia.web.admin.comms.MsgTagInline'>]
form

alias of MsgForm

list_display = ('id', 'db_date_created', 'sender', 'receiver', 'start_of_message')
ordering = ['-db_date_created', '-id']
search_fields = ['=id', '^db_date_created', '^db_message', '^db_sender_accounts__db_key', '^db_sender_objects__db_key', '^db_sender_scripts__db_key', '^db_sender_external', '^db_receivers_accounts__db_key', '^db_receivers_objects__db_key', '^db_receivers_scripts__db_key', '^db_receiver_external']
readonly_fields = ['db_date_created', 'serialized_string']
save_as = True
save_on_top = True
view_on_site = False
raw_id_fields = ('db_sender_accounts', 'db_sender_objects', 'db_sender_scripts', 'db_receivers_accounts', 'db_receivers_objects', 'db_receivers_scripts', 'db_hide_from_accounts', 'db_hide_from_objects')
fieldsets = ((None, {'fields': (('db_sender_accounts', 'db_sender_objects', 'db_sender_scripts', 'db_sender_external'), ('db_receivers_accounts', 'db_receivers_objects', 'db_receivers_scripts', 'db_receiver_external'), ('db_hide_from_accounts', 'db_hide_from_objects'), 'db_header', 'db_message', 'serialized_string')}),)
sender(obj)[source]
receiver(obj)[source]
start_of_message(obj)[source]
serialized_string(obj)[source]

Get the serialized version of the object.

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

Overrides help texts.

property media
class evennia.web.admin.comms.ChannelAttributeInline(parent_model, admin_site)[source]

Bases: evennia.web.admin.attributes.AttributeInline

Inline display of Channel Attribute - experimental

model

alias of evennia.comms.models.ChannelDB_db_attributes

related_field = 'channeldb'
property media
class evennia.web.admin.comms.ChannelTagInline(parent_model, admin_site)[source]

Bases: evennia.web.admin.tags.TagInline

Inline display of Channel Tags - experimental

model

alias of evennia.comms.models.ChannelDB_db_tags

related_field = 'channeldb'
property media
class evennia.web.admin.comms.ChannelForm(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

Form for accessing channels.

class Meta[source]

Bases: object

model

alias of evennia.comms.models.ChannelDB

fields = '__all__'
base_fields = {'db_account_subscriptions': <django.forms.models.ModelMultipleChoiceField object>, 'db_attributes': <django.forms.models.ModelMultipleChoiceField object>, 'db_key': <django.forms.fields.CharField object>, 'db_lock_storage': <django.forms.fields.CharField object>, 'db_object_subscriptions': <django.forms.models.ModelMultipleChoiceField object>, 'db_tags': <django.forms.models.ModelMultipleChoiceField object>, 'db_typeclass_path': <django.forms.fields.CharField object>}
declared_fields = {'db_lock_storage': <django.forms.fields.CharField object>}
property media

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

class evennia.web.admin.comms.ChannelAdmin(model, admin_site)[source]

Bases: django.contrib.admin.options.ModelAdmin

Defines display for Channel objects

inlines = [<class 'evennia.web.admin.comms.ChannelTagInline'>, <class 'evennia.web.admin.comms.ChannelAttributeInline'>]
form

alias of ChannelForm

list_display = ('id', 'db_key', 'no_of_subscribers', 'db_lock_storage', 'db_typeclass_path', 'db_date_created')
ordering = ['-db_date_created', '-id', '-db_key']
search_fields = ['id', 'db_key', 'db_tags__db_key']
readonly_fields = ['serialized_string']
save_as = True
save_on_top = True
raw_id_fields = ('db_object_subscriptions', 'db_account_subscriptions')
fieldsets = ((None, {'fields': (('db_key',), 'db_lock_storage', 'db_account_subscriptions', 'db_object_subscriptions', 'serialized_string')}),)
subscriptions(obj)[source]

Helper method to get subs from a channel.

Parameters

obj (Channel) – The channel to get subs from.

no_of_subscribers(obj)[source]

Get number of subs for a a channel .

Parameters

obj (Channel) – The channel to get subs from.

serialized_string(obj)[source]

Get the serialized version of the object.

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

Overrides help texts.

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