evennia.accounts.manager¶
The managers for the custom Account object and permissions.
-
class
evennia.accounts.manager.
AccountManager
(*args, **kwargs)[source]¶ Bases:
evennia.accounts.manager.AccountDBManager
,evennia.typeclasses.managers.TypeclassManager
-
class
evennia.accounts.manager.
AccountDBManager
(*args, **kwargs)[source]¶ Bases:
evennia.typeclasses.managers.TypedObjectManager
,django.contrib.auth.models.UserManager
This AccountManager implements methods for searching and manipulating Accounts directly from the database.
Evennia-specific search methods (will return Characters if possible or a Typeclass/list of Typeclassed objects, whereas Django-general methods will return Querysets or database objects):
dbref (converter) dbref_search get_dbref_range object_totals typeclass_search num_total_accounts get_connected_accounts get_recently_created_accounts get_recently_connected_accounts get_account_from_email get_account_from_uid get_account_from_name account_search (equivalent to evennia.search_account)
-
num_total_accounts
()[source]¶ Get total number of accounts.
- Returns
count (int) – The total number of registered accounts.
-
get_connected_accounts
()[source]¶ Get all currently connected accounts.
- Returns
count (list) –
- Account objects with currently
connected sessions.
-
get_recently_created_accounts
(days=7)[source]¶ Get accounts recently created.
- Parameters
days (int, optional) – How many days in the past “recently” means.
- Returns
accounts (list) – The Accounts created the last days interval.
-
get_recently_connected_accounts
(days=7)[source]¶ Get accounts recently connected to the game.
- Parameters
days (int, optional) – Number of days backwards to check
- Returns
accounts (list) –
- The Accounts connected to the game in the
last days interval.
-
get_account_from_email
(uemail)[source]¶ Search account by Returns an account object based on email address.
- Parameters
uemail (str) – An email address to search for.
- Returns
account (Account) – A found account, if found.
-
get_account_from_uid
(uid)[source]¶ Get an account by id.
- Parameters
uid (int) – Account database id.
- Returns
account (Account) – The result.
-
get_account_from_name
(uname)[source]¶ Get account object based on name.
- Parameters
uname (str) – The Account name to search for.
- Returns
account (Account) – The found account.
-
search_account
(ostring, exact=True, typeclass=None)[source]¶ Searches for a particular account by name or database id.
- Parameters
ostring (str or int) – A key string or database id.
exact (bool, optional) – Only valid for string matches. If True, requires exact (non-case-sensitive) match, otherwise also match also keys containing the ostring (non-case-sensitive fuzzy match).
typeclass (str or Typeclass, optional) – Limit the search only to accounts of this typeclass.
-
account_search
(ostring, exact=True, typeclass=None)¶ Searches for a particular account by name or database id.
- Parameters
ostring (str or int) – A key string or database id.
exact (bool, optional) – Only valid for string matches. If True, requires exact (non-case-sensitive) match, otherwise also match also keys containing the ostring (non-case-sensitive fuzzy match).
typeclass (str or Typeclass, optional) – Limit the search only to accounts of this typeclass.
-