username_tools package¶
Submodules¶
username_tools.admin module¶
username_tools.apps module¶
username_tools.blacklist module¶
username_tools.fields module¶
-
class
username_tools.fields.UsernameFormField(*args, **kwargs)[source]¶ Bases:
django.forms.fields.CharFieldA forms.CharField subclass that comes with validation for blacklisted usernames.
-
class
username_tools.fields.UsernameModelField(*args, **kwargs)[source]¶ Bases:
django.db.models.fields.CharFieldA models.CharField subclass that comes with validation for blacklisted usernames.
-
default_error_messages= {'unique': 'A user with that username already exists.'}¶
-
default_validators= [<django.contrib.auth.validators.UnicodeUsernameValidator object>]¶
-
username_tools.models module¶
-
class
username_tools.models.UsernameBlacklist(id, username, is_blocked)[source]¶ Bases:
django.db.models.base.ModelParameters: - id (AutoField) – Id
- username (CharField) – Username to black list
- is_blocked (BooleanField) – Set this to False if you need to whitelist this username but don’t want to delete it. This also ensures that a whitelisted username will stay whitelisted when re-populating using the populate manager method.
-
exception
DoesNotExist¶ Bases:
django.core.exceptions.ObjectDoesNotExist
-
exception
MultipleObjectsReturned¶ Bases:
django.core.exceptions.MultipleObjectsReturned
-
id¶ Model field: ID
-
is_blocked¶ Model field: is blocked
-
objects= <username_tools.models.UsernameBlacklistManager object>¶
-
username¶ Model field: username