Users
This package contains all data models related to users:
user.
User
- class integreat_compass.cms.models.users.user.CustomUserManager(*args, **kwargs)
Bases:
BaseUserManagerThis manager provides custom methods for user creation
- create_superuser(email, display_name, password=None, **extra_fields)
Create a new super user
- create_user(email, display_name, password=None, group=None, **extra_fields)
Create a new user and ensure they are added to the correct group (if any)
- class integreat_compass.cms.models.users.user.User(*args, **kwargs)
Bases:
AbstractBaseUser,PermissionsMixin,AbstractBaseModelA custom User model that replaces the default Django User model.
- Parameters:
id (BigAutoField) – Primary key: ID
password (CharField) – Password
last_login (DateTimeField) – Last login
is_superuser (BooleanField) – Superuser status. Designates that this user has all permissions without explicitly assigning them.
email (EmailField) – Email. Valid email address for this user
display_name (CharField) – Display name. This name will be shown as the author of votes, comments, etc.
is_active (BooleanField) – Is active
is_staff (BooleanField) – Is staff
Relationship fields:
- Parameters:
groups (
ManyToManyFieldtoGroup) – Groups. The groups this user belongs to. A user will get all permissions granted to each of their groups. (related name:user_set)user_permissions (
ManyToManyFieldtoPermission) – User permissions. Specific permissions for this user. (related name:user_set)
Reverse relationships:
- Parameters:
comments (Reverse
ForeignKeyfromComment) – All comments of this user (related name ofcreator)offer (Reverse
ForeignKeyfromOffer) – All offers of this user (related name ofcreator)favorite (Reverse
ForeignKeyfromFavorite) – All favorite of this user (related name ofcreator)votes (Reverse
ForeignKeyfromVote) – All votes of this user (related name ofcreator)offer_contact (Reverse
ForeignKeyfromContact) – All offer contact of this user (related name ofcreator)organization (Reverse
ForeignKeyfromOrganization) – All organization of this user (related name ofcreator)logentry (Reverse
ForeignKeyfromLogEntry) – All log entries of this user (related name ofuser)
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- REQUIRED_FIELDS = ['display_name']
- USERNAME_FIELD = 'email'
- comments
Type: Reverse
ForeignKeyfromCommentAll comments of this user (related name of
creator)
- display_name
Type:
CharFieldDisplay name. This name will be shown as the author of votes, comments, etc.
- email
Type:
EmailFieldEmail. Valid email address for this user
- favorite
Type: Reverse
ForeignKeyfromFavoriteAll favorite of this user (related name of
creator)
- get_repr()
This overwrites the default Django
__repr__()method which would return<User: User object (id)>. It is used for logging.- Returns:
The canonical string representation of the user
- Return type:
- group
Return the primary group of this user
- Returns:
The first group of this user
- Return type:
- groups
Type:
ManyToManyFieldtoGroupGroups. The groups this user belongs to. A user will get all permissions granted to each of their groups. (related name:
user_set)
- id
Type:
BigAutoFieldPrimary key: ID
- is_active
Type:
BooleanFieldIs active
- is_staff
Type:
BooleanFieldIs staff
- is_superuser
Type:
BooleanFieldSuperuser status. Designates that this user has all permissions without explicitly assigning them.
- last_login
Type:
DateTimeFieldLast login
- logentry_set
Type: Reverse
ForeignKeyfromLogEntryAll log entries of this user (related name of
user)
- objects = <integreat_compass.cms.models.users.user.CustomUserManager object>
- offer_contact
Type: Reverse
ForeignKeyfromContactAll offer contact of this user (related name of
creator)
- offer_set
Type: Reverse
ForeignKeyfromOfferAll offers of this user (related name of
creator)
- organization
Type: Reverse
ForeignKeyfromOrganizationAll organization of this user (related name of
creator)
- user_permissions
Type:
ManyToManyFieldtoPermissionUser permissions. Specific permissions for this user. (related name:
user_set)
- votes
Type: Reverse
ForeignKeyfromVoteAll votes of this user (related name of
creator)