eucrim.users package
Submodules
eucrim.users.apps module
eucrim.users.forms module
- class eucrim.users.forms.CustomUserCreationForm(*args, **kwargs)[source]
Bases:
UserCreationFormCustom user attributes in the wagtail admin UserCreationForm.
- class Meta[source]
Bases:
Meta- fields = {'email', 'first_name', 'groups', 'is_association_manager', 'is_author', 'is_superuser', 'is_team', 'last_name', 'team_role', 'username'}
- base_fields = {'email': <django.forms.fields.EmailField object>, 'first_name': <django.forms.fields.CharField object>, 'groups': <django.forms.models.ModelMultipleChoiceField object>, 'is_association_manager': <django.forms.fields.BooleanField object>, 'is_author': <django.forms.fields.BooleanField object>, 'is_superuser': <django.forms.fields.BooleanField object>, 'is_team': <django.forms.fields.BooleanField object>, 'last_name': <django.forms.fields.CharField object>, 'password1': <django.forms.fields.CharField object>, 'password2': <django.forms.fields.CharField object>, 'team_role': <django.forms.fields.ChoiceField object>, 'username': <django.forms.fields.CharField object>}
- declared_fields = {'email': <django.forms.fields.EmailField object>, 'first_name': <django.forms.fields.CharField object>, 'is_association_manager': <django.forms.fields.BooleanField object>, 'is_author': <django.forms.fields.BooleanField object>, 'is_superuser': <django.forms.fields.BooleanField object>, 'is_team': <django.forms.fields.BooleanField object>, 'last_name': <django.forms.fields.CharField object>, 'password1': <django.forms.fields.CharField object>, 'password2': <django.forms.fields.CharField object>, 'team_role': <django.forms.fields.ChoiceField object>}
- property media
Return all media required to render the widgets on this form.
- class eucrim.users.forms.CustomUserEditForm(*args, **kwargs)[source]
Bases:
UserEditFormCustom user attributes in the wagtail admin UserEditForm.
- class Meta[source]
Bases:
Meta- fields = {'email', 'first_name', 'groups', 'is_active', 'is_association_manager', 'is_author', 'is_superuser', 'is_team', 'last_name', 'team_role', 'username'}
- base_fields = {'email': <django.forms.fields.EmailField object>, 'first_name': <django.forms.fields.CharField object>, 'groups': <django.forms.models.ModelMultipleChoiceField object>, 'is_active': <django.forms.fields.BooleanField object>, 'is_association_manager': <django.forms.fields.BooleanField object>, 'is_author': <django.forms.fields.BooleanField object>, 'is_superuser': <django.forms.fields.BooleanField object>, 'is_team': <django.forms.fields.BooleanField object>, 'last_name': <django.forms.fields.CharField object>, 'password1': <django.forms.fields.CharField object>, 'password2': <django.forms.fields.CharField object>, 'team_role': <django.forms.fields.ChoiceField object>, 'username': <django.forms.fields.CharField object>}
- declared_fields = {'email': <django.forms.fields.EmailField object>, 'first_name': <django.forms.fields.CharField object>, 'is_association_manager': <django.forms.fields.BooleanField object>, 'is_author': <django.forms.fields.BooleanField object>, 'is_superuser': <django.forms.fields.BooleanField object>, 'is_team': <django.forms.fields.BooleanField object>, 'last_name': <django.forms.fields.CharField object>, 'password1': <django.forms.fields.CharField object>, 'password2': <django.forms.fields.CharField object>, 'team_role': <django.forms.fields.ChoiceField object>}
- property media
Return all media required to render the widgets on this form.
eucrim.users.models module
- class eucrim.users.models.CustomUser(*args, **kwargs)[source]
Bases:
AbstractUserCustomUser model for eucrim users with additional attributes. See also: http://docs.wagtail.io/en/v2.0.1/advanced_topics/customisation/custom_user_models.html
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- EDITOR = '30_EDT'
- EDITORIAL_ASSISTENT = '90_EAS'
- EDITORIAL_BOARD = '40_EDB'
- EDITOR_IN_CHIEF = '10_EIC'
- LANGUAGE_CONSULTANT = '50_LCN'
- MANAGING_DIRECTOR = '20_MDR'
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- NOROLE = '99_NRL'
- exception NotUpdated
Bases:
ObjectNotUpdated,DatabaseError
- STUDENT_ASSISTANT = '80_SAS'
- TEAM_ROLE_CHOICES = (('10_EIC', 'Editor in Chief'), ('20_MDR', 'Managing Editor'), ('30_EDT', 'Editor'), ('40_EDB', 'Editorial Board'), ('50_LCN', 'Language Consultant'), ('60_TYS', 'Typeset'), ('70_WEB', 'Developer'), ('80_SAS', 'Student Assistent'), ('90_EAS', 'Editorial Assistent'), ('99_NRL', 'no role'))
- TYPESET = '60_TYS'
- WEB = '70_WEB'
- comment_replies
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.childrenis aReverseManyToOneDescriptorinstance.Most of the implementation is delegated to a dynamically defined manager class built by
create_reverse_many_to_one_manager()defined below.
- comments_resolved
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.childrenis aReverseManyToOneDescriptorinstance.Most of the implementation is delegated to a dynamically defined manager class built by
create_reverse_many_to_one_manager()defined below.
- date_joined
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- document_set
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.childrenis aReverseManyToOneDescriptorinstance.Most of the implementation is delegated to a dynamically defined manager class built by
create_reverse_many_to_one_manager()defined below.
- editing_sessions
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.childrenis aReverseManyToOneDescriptorinstance.Most of the implementation is delegated to a dynamically defined manager class built by
create_reverse_many_to_one_manager()defined below.
- email
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- finished_task_states
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.childrenis aReverseManyToOneDescriptorinstance.Most of the implementation is delegated to a dynamically defined manager class built by
create_reverse_many_to_one_manager()defined below.
- first_name
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- classmethod from_db(db, field_names, values)[source]
Get old values from db. see: https://docs.djangoproject.com/el/2.1/ref/models/instances/#customizing-model-loading
- get_next_by_date_joined(*, field=<django.db.models.fields.DateTimeField: date_joined>, is_next=True, **kwargs)
- get_previous_by_date_joined(*, field=<django.db.models.fields.DateTimeField: date_joined>, is_next=False, **kwargs)
- property get_profilepage
- get_team_role_display(*, field=<django.db.models.fields.CharField: team_role>)
- groups
Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.
In the example:
class Pizza(Model): toppings = ManyToManyField(Topping, related_name='pizzas')
Pizza.toppingsandTopping.pizzasareManyToManyDescriptorinstances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()defined below.
- id
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- image_set
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.childrenis aReverseManyToOneDescriptorinstance.Most of the implementation is delegated to a dynamically defined manager class built by
create_reverse_many_to_one_manager()defined below.
- is_active
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- is_association_manager
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- is_author
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- is_staff
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- is_superuser
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- is_team
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- last_login
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- last_name
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- locked_pages
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.childrenis aReverseManyToOneDescriptorinstance.Most of the implementation is delegated to a dynamically defined manager class built by
create_reverse_many_to_one_manager()defined below.
- logentry_set
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.childrenis aReverseManyToOneDescriptorinstance.Most of the implementation is delegated to a dynamically defined manager class built by
create_reverse_many_to_one_manager()defined below.
- owned_pages
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.childrenis aReverseManyToOneDescriptorinstance.Most of the implementation is delegated to a dynamically defined manager class built by
create_reverse_many_to_one_manager()defined below.
- page_subscriptions
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.childrenis aReverseManyToOneDescriptorinstance.Most of the implementation is delegated to a dynamically defined manager class built by
create_reverse_many_to_one_manager()defined below.
- password
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- profilepage
Accessor to the related object on the reverse side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Place.restaurantis aReverseOneToOneDescriptorinstance.
- requested_workflows
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.childrenis aReverseManyToOneDescriptorinstance.Most of the implementation is delegated to a dynamically defined manager class built by
create_reverse_many_to_one_manager()defined below.
- save(*args, **kwargs)[source]
Custom model save method to trigger some tasks. We need to know if this instance is a new or modified one, we need to know if certain fields have changed (e.g. if user had not is_author flag but does has now, we need to create a ProfilePage for him). So we are interessted in the fields that have changed and their new value.
- team_role
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- uploadedfile_set
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.childrenis aReverseManyToOneDescriptorinstance.Most of the implementation is delegated to a dynamically defined manager class built by
create_reverse_many_to_one_manager()defined below.
- user_permissions
Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.
In the example:
class Pizza(Model): toppings = ManyToManyField(Topping, related_name='pizzas')
Pizza.toppingsandTopping.pizzasareManyToManyDescriptorinstances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()defined below.
- username
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- wagtail_admin_comments
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.childrenis aReverseManyToOneDescriptorinstance.Most of the implementation is delegated to a dynamically defined manager class built by
create_reverse_many_to_one_manager()defined below.
- wagtail_revisions
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.childrenis aReverseManyToOneDescriptorinstance.Most of the implementation is delegated to a dynamically defined manager class built by
create_reverse_many_to_one_manager()defined below.
- wagtail_userprofile
Accessor to the related object on the reverse side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Place.restaurantis aReverseOneToOneDescriptorinstance.
eucrim.users.profile_management module
This module handles the creation or update of ProfilePages for user instances and notifications in various cases.
- eucrim.users.profile_management.create_profile_page(instance)[source]
Adding a new ProfilePage for a given user.
- eucrim.users.profile_management.modify_profile_page(instance, user_state_action, fields_changed)[source]
- eucrim.users.profile_management.notify_association_manager(instance, user_state_action, fields_changed)[source]
Notify new association managers via email. Only send email if user with ‘is_association_manager’ is added or existing user gets ‘is_association_manager’.