evennia.help.models

Models for the help system.

The database-tied help system is only half of Evennia’s help functionality, the other one being the auto-generated command help that is created on the fly from each command’s __doc__ string. The persistent database system defined here is intended for all other forms of help that do not concern commands, like information about the game world, policy info, rules and similar.

class evennia.help.models.HelpEntry(*args, **kwargs)[source]

Bases: evennia.utils.idmapper.models.SharedMemoryModel

A generic help entry.

An HelpEntry object has the following properties defined:

key - main name of entry help_category - which category entry belongs to (defaults to General) entrytext - the actual help text permissions - perm strings

Method:

access

db_key

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

db_help_category

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

db_entrytext

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

db_lock_storage

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

db_tags

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

**Pizza.toppings** and **Topping.pizzas** are **ManyToManyDescriptor** instances.

Most of the implementation is delegated to a dynamically defined manager class built by **create_forward_many_to_many_manager()** defined below.

db_date_created

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <evennia.help.manager.HelpEntryManager object>
locks[source]
tags[source]
aliases[source]
property date_created

Return the field in localized time based on settings.TIME_ZONE.

access(accessing_obj, access_type='read', default=True)[source]

Determines if another object has permission to access this help entry.

Accesses used by default:

‘read’ - read the help entry itself. ‘view’ - see help entry in help index.

Parameters
  • accessing_obj (Object or Account) – Entity trying to access this one.

  • access_type (str) – type of access sought.

  • default (bool) – What to return if no lock of access_type was found.

property search_index_entry

Property for easily retaining a search index entry for this object.

web_get_admin_url()[source]

Returns the URI path for the Django Admin page for this object.

ex. Account#1 = ‘/admin/accounts/accountdb/1/change/’

Returns

path (str) – URI path to Django Admin page for object.

classmethod web_get_create_url()[source]

Returns the URI path for a View that allows users to create new instances of this object.

ex. Chargen = ‘/characters/create/’

For this to work, the developer must have defined a named view somewhere in urls.py that follows the format ‘modelname-action’, so in this case a named view of ‘character-create’ would be referenced by this method.

ex.

url(r'characters/create/', ChargenView.as_view(), name='character-create')

If no View has been created and defined in urls.py, returns an HTML anchor.

This method is naive and simply returns a path. Securing access to the actual view and limiting who can create new objects is the developer’s responsibility.

Returns

path (str) – URI path to object creation page, if defined.

web_get_detail_url()[source]

Returns the URI path for a View that allows users to view details for this object.

ex. Oscar (Character) = ‘/characters/oscar/1/’

For this to work, the developer must have defined a named view somewhere in urls.py that follows the format ‘modelname-action’, so in this case a named view of ‘character-detail’ would be referenced by this method.

ex.

url(r'characters/(?P<slug>[\w\d\-]+)/(?P<pk>[0-9]+)/$',
    CharDetailView.as_view(), name='character-detail')

If no View has been created and defined in urls.py, returns an HTML anchor.

This method is naive and simply returns a path. Securing access to the actual view and limiting who can view this object is the developer’s responsibility.

Returns

path (str) – URI path to object detail page, if defined.

web_get_update_url()[source]

Returns the URI path for a View that allows users to update this object.

ex. Oscar (Character) = ‘/characters/oscar/1/change/’

For this to work, the developer must have defined a named view somewhere in urls.py that follows the format ‘modelname-action’, so in this case a named view of ‘character-update’ would be referenced by this method.

ex.

url(r'characters/(?P<slug>[\w\d\-]+)/(?P<pk>[0-9]+)/change/$',
    CharUpdateView.as_view(), name='character-update')

If no View has been created and defined in urls.py, returns an HTML anchor.

This method is naive and simply returns a path. Securing access to the actual view and limiting who can modify objects is the developer’s responsibility.

Returns

path (str) – URI path to object update page, if defined.

web_get_delete_url()[source]

Returns the URI path for a View that allows users to delete this object.

ex. Oscar (Character) = ‘/characters/oscar/1/delete/’

For this to work, the developer must have defined a named view somewhere in urls.py that follows the format ‘modelname-action’, so in this case a named view of ‘character-detail’ would be referenced by this method.

ex.

url(r'characters/(?P<slug>[\w\d\-]+)/(?P<pk>[0-9]+)/delete/$',
    CharDeleteView.as_view(), name='character-delete')

If no View has been created and defined in urls.py, returns an HTML anchor.

This method is naive and simply returns a path. Securing access to the actual view and limiting who can delete this object is the developer’s responsibility.

Returns

path (str) – URI path to object deletion page, if defined.

get_absolute_url()

Returns the URI path for a View that allows users to view details for this object.

ex. Oscar (Character) = ‘/characters/oscar/1/’

For this to work, the developer must have defined a named view somewhere in urls.py that follows the format ‘modelname-action’, so in this case a named view of ‘character-detail’ would be referenced by this method.

ex.

url(r'characters/(?P<slug>[\w\d\-]+)/(?P<pk>[0-9]+)/$',
    CharDetailView.as_view(), name='character-detail')

If no View has been created and defined in urls.py, returns an HTML anchor.

This method is naive and simply returns a path. Securing access to the actual view and limiting who can view this object is the developer’s responsibility.

Returns

path (str) – URI path to object detail page, if defined.

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

property entrytext

A wrapper for getting database field db_entrytext.

get_next_by_db_date_created(*, field=<django.db.models.fields.DateTimeField: db_date_created>, is_next=True, **kwargs)
get_previous_by_db_date_created(*, field=<django.db.models.fields.DateTimeField: db_date_created>, is_next=False, **kwargs)
property help_category

A wrapper for getting database field db_help_category.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

property key

A wrapper for getting database field db_key.

property lock_storage

A wrapper for getting database field db_lock_storage.

path = 'evennia.help.models.HelpEntry'
typename = 'SharedMemoryModelBase'