user.models.User
- class user.models.User(*args, **kwargs)[source]
Users within the Django authentication system are represented by this model.
- username
Username for login.
- Type:
django.models.CharField
- first_name
User’s first name.
- Type:
django.models.CharField, optional
- last_name
User’s last name.
- Type:
django.models.CharField, optional
- email
User’s email. Used to send forgotten password links.
- Type:
django.models.EmailField, optional
- is_staff
Designates whether the user can log into this admin site.
- Type:
django.models.BooleanField
- is_active
Designates whether this user should be treated as active. Unselect this instead of deleting accounts.
- Type:
django.models.BooleanField
- date_joined
The user’s registration date.
- Type:
django.models.DateTimeField
- is_sqluser_view
SQL explorer user status (view/execute existing queries only)
- Type:
django.models.BooleanField
- is_sqluser_change
SQL explorer user status (view/add/change/delete/execute)
- Type:
django.models.BooleanField
- is_catalogviewer
Dataset Catalog user status (readonly)
- Type:
django.models.BooleanField
- __init__(*args, **kwargs)
Methods
__init__(*args, **kwargs)acheck_password(raw_password)See check_password().
adelete([using, keep_parents])arefresh_from_db([using, fields, from_queryset])asave(*args[, force_insert, force_update, ...])check(**kwargs)check_password(raw_password)Return a boolean of whether the raw_password was correct.
clean()Hook for doing any extra model-wide validation after clean() has been called on every field by self.clean_fields.
clean_fields([exclude])Clean all fields and raise a ValidationError containing a dict of all validation errors if any occur.
date_error_message(lookup_type, field_name, ...)delete([using, keep_parents])email_user(subject, message[, from_email])Send an email to this user.
from_db(db, field_names, values)full_clean([exclude, validate_unique, ...])Call clean_fields(), clean(), validate_unique(), and validate_constraints() on the model.
get_all_permissions([obj])get_constraints()get_deferred_fields()Return a set containing names of deferred fields for this instance.
get_email_field_name()get_full_name()Return the first_name plus the last_name, with a space in between.
get_group_permissions([obj])Return a list of permission strings that this user has through their groups.
get_next_by_date_joined(*[, field, is_next])get_previous_by_date_joined(*[, field, is_next])get_session_auth_fallback_hash()get_session_auth_hash()Return an HMAC of the password field.
get_short_name()Return the short name for the user.
get_user_permissions([obj])Return a list of permission strings that this user has directly.
get_username()Return the username for this User.
has_module_perms(app_label)Return True if the user has any permissions in the given app label.
has_perm(perm[, obj])Return True if the user has the specified permission.
has_perms(perm_list[, obj])Return True if the user has each of the specified permissions.
has_usable_password()Return False if set_unusable_password() has been called for this user.
natural_key()normalize_username(username)prepare_database_save(field)refresh_from_db([using, fields, from_queryset])Reload field values from the database.
save(*args, **kwargs)Save the current instance.
save_base([raw, force_insert, force_update, ...])Handle the parts of saving which should be done only once per save, yet need to be done in raw saves, too.
serializable_value(field_name)Return the value of the field name for this instance.
set_password(raw_password)set_unusable_password()unique_error_message(model_class, unique_check)validate_constraints([exclude])validate_unique([exclude])Check unique constraints on the model and raise ValidationError if any failed.
Attributes
EMAIL_FIELDREQUIRED_FIELDSUSERNAME_FIELDAccessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
center_idA wrapper for a deferred-loading field.
A wrapper for a deferred-loading field.
favoritesAccessor to the related objects manager on the reverse side of a many-to-one relation.
A wrapper for a deferred-loading field.
groupsAccessor to the related objects manager on the forward and reverse sides of a many-to-many relation.
idA wrapper for a deferred-loading field.
A wrapper for a deferred-loading field.
is_anonymousAlways return False.
is_authenticatedAlways return True.
A wrapper for a deferred-loading field.
A wrapper for a deferred-loading field.
A wrapper for a deferred-loading field.
A wrapper for a deferred-loading field.
is_superuserA wrapper for a deferred-loading field.
last_loginA wrapper for a deferred-loading field.
A wrapper for a deferred-loading field.
logentry_setAccessor to the related objects manager on the reverse side of a many-to-one relation.
objectspasswordA wrapper for a deferred-loading field.
pkpromptlog_setAccessor to the related objects manager on the reverse side of a many-to-one relation.
query_setAccessor to the related objects manager on the reverse side of a many-to-one relation.
querylog_setAccessor to the related objects manager on the reverse side of a many-to-one relation.
user_permissionsAccessor to the related objects manager on the forward and reverse sides of a many-to-many relation.
A wrapper for a deferred-loading field.
username_validator