Model classes¶
In order to be able to associate every user who has configured the latch with
the Latch service and check its status (on or off), django-latch has to
store the parameter that uniquely identify a user against the Latch service:
an account id.
Following the Django’s guidelines for extending the User model the account id is stored in a separate table from the User one, along with a foreign key pointing to the respective user.
- class django_latch.models.LatchUserConfig(*args, **kwargs)[source]¶
Store the necessary configuration to associate a user to the Latch service.
- user¶
A
OneToOneFieldthat identifies the user who has configured the Latch service.
- Parameters:
id (BigAutoField) – Primary key: ID
account_id (CharField) – Account id
Relationship fields:
- Parameters:
user (
OneToOneFieldtoUser) – User (related name:latch_config)