evennia.web.admin.utils

Helper utils for admin views.

evennia.web.admin.utils.get_and_load_typeclasses(parent=None, excluded_parents=None)[source]

Get all typeclasses. We we need to initialize things here for them to be actually available in the admin process. This is intended to be used with forms.ChoiceField.

Parameters
  • parent (str or class, optional) – Limit selection to this class and its children (at any distance).

  • exclude (list) – Class-parents to exclude from the resulting list. All children of these paretns will be skipped.

Returns

list – A list of (str, str), the way ChoiceField wants it.

evennia.web.admin.utils.get_and_load_cmdsets(parent=None, excluded_parents=None)[source]

Get all cmdsets available or as children based on a parent cmdset. We need to initialize things here to make sure as much as possible is loaded in the admin process. This is intended to be used with forms.ChoiceField.

Parameters
  • parent (str, optional) – Python-path to the parent cmdset, if any.

  • excluded_parents (list) – A list of cmset-paths to exclude from the result.

Returns

list – A list of (str, str), the way ChoiceField wants it.