Models
Models to mimic users and virtual organizations of the Helmholtz AAI in Django.
Models:
|
A User in the in the Helmholtz AAI. |
|
A VO in the Helmholtz AAI. |
Classes:
|
A manager for the helmholtz User. |
|
Database manager for the |
A queryset with an extra command to remove empty VOs. |
- class django_helmholtz_aai.models.HelmholtzUser(*args, **kwargs)
Bases:
django.contrib.auth.models.User
A User in the in the Helmholtz AAI.
- Parameters
id (AutoField) – 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.
username (CharField) – Username. Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.
first_name (CharField) – First name
last_name (CharField) – Last name
email (EmailField) – Email address
is_staff (BooleanField) – Staff status. Designates whether the user can log into this admin site.
is_active (BooleanField) – Active. Designates whether this user should be treated as active. Unselect this instead of deleting accounts.
date_joined (DateTimeField) – Date joined
groups (ManyToManyField) – Groups. The groups this user belongs to. A user will get all permissions granted to each of their groups.
user_permissions (ManyToManyField) – User permissions. Specific permissions for this user.
user_ptr (OneToOneField to
User
) – User ptreduperson_unique_id (CharField) – Eduperson unique id
Miscellaneous:
Model Fields:
Model field: eduperson unique id
Model field: user ptr, accesses the
User
model.Attributes:
Model field: user ptr
- exception DoesNotExist
Bases:
django.contrib.auth.models.User.DoesNotExist
- exception MultipleObjectsReturned
Bases:
django.contrib.auth.models.User.MultipleObjectsReturned
- eduperson_unique_id
Model field: eduperson unique id
- objects = <django_helmholtz_aai.models.HelmholtzUserManager object>
- user_ptr_id
Model field: user ptr
- class django_helmholtz_aai.models.HelmholtzUserManager(*args, **kwargs)
Bases:
django.contrib.auth.models.UserManager
A manager for the helmholtz User.
Methods:
create_aai_user
(userinfo)Create a user from the Helmholtz AAI userinfo.
- create_aai_user(userinfo)
Create a user from the Helmholtz AAI userinfo.
- class django_helmholtz_aai.models.HelmholtzVirtualOrganization(*args, **kwargs)
Bases:
django.contrib.auth.models.Group
A VO in the Helmholtz AAI.
- Parameters
id (AutoField) – Id
name (CharField) – Name
permissions (ManyToManyField) – Permissions
group_ptr (OneToOneField to
Group
) – Group ptreduperson_entitlement (CharField) – Eduperson entitlement
Miscellaneous:
Attributes:
Model field: group ptr
Model Fields:
Model field: eduperson entitlement
Model field: group ptr, accesses the
Group
model.- exception DoesNotExist
Bases:
django.contrib.auth.models.Group.DoesNotExist
- exception MultipleObjectsReturned
Bases:
django.contrib.auth.models.Group.MultipleObjectsReturned
- eduperson_entitlement
Model field: eduperson entitlement
- group_ptr_id
Model field: group ptr
- objects = <django_helmholtz_aai.models.HelmholtzVirtualOrganizationManager object>
- class django_helmholtz_aai.models.HelmholtzVirtualOrganizationManager(*args, **kwargs)
Bases:
django.db.models.manager.GroupManagerFromHelmholtzVirtualOrganizationQuerySet
Database manager for the
HelmholtzVirtualOrganization
model.
- class django_helmholtz_aai.models.HelmholtzVirtualOrganizationQuerySet(model=None, query=None, using=None, hints=None)
Bases:
django.db.models.query.QuerySet
A queryset with an extra command to remove empty VOs.
Methods:
remove_empty_vos
([exclude, without_confirmation])Remove empty virtual organizations.
- remove_empty_vos(exclude: list[str] = [], without_confirmation: bool = True) list[HelmholtzVirtualOrganization]
Remove empty virtual organizations.
This method filters for virtual organizations in the queryset and removes them.
- Parameters
exclude (list[str]) – A list of strings that will be interpreted as regular expressions. If a
eduperson_entitlement
matches any of these strings, it will not be removed.without_confirmation (bool) – If True (default), remove the VO without asking for confirmation using python’s built-in
input()
from the command-line.
- Returns
The list of virtual organizations that have been removed
- Return type