Skip to content
Camille Masset edited this page Apr 26, 2016 · 2 revisions

Users

General facts

The model User is quite classical: it gathers basic data about the user (name, email, profile photo, ...).
The users are related to other objects in the application:

  • cluster: a user must be member of at least one cluster;
  • groups: a user can be a member of a group:
    • if a user is invited to a group, the group is visible in its invited_to_groups field;
    • if a user belongs to a group, the membership is in the field groups (which is a list).

Proper fields

  • email (string) : is used for authentication
  • lastname (string)
  • firstname (string)
  • username (string, should be unique #TODO)
  • phone (string, 21 chars)
  • photo (model sigma_files.Image)
  • is_active (boolean, default: True)
  • last_modified (datetime)
  • join_date (datetime)
  • is_superuser (boolean, default: False)
  • is_staff (boolean, default: False)

Relation fields

  • clusters (M2M with Cluster, related name: cluster_users) : users should be members of at least one cluster
  • invited_to_groups (M2M with Group , related name: invited_users)
  • groups (M2M with Group through GroupMember, related name: users)
Clone this wiki locally