thunderbird_accounts.legal.models

Classes

LegalDocument(uuid, created_at, updated_at, ...)

LegalDocumentResponse(*args, **kwargs)

Audit log of user responses (accept/decline) to legal documents.

class thunderbird_accounts.legal.models.LegalDocument(uuid, created_at, updated_at, document_type, version, is_current, content_path)[source]

Bases: BaseModel

Parameters:
  • uuid (UUIDField) – Primary key: Uuid

  • created_at (DateTimeField) – Created at

  • updated_at (DateTimeField) – Updated at

  • document_type (CharField) – Document type

  • version (CharField) – Version. Version number of the document, e.g. “1.0”

  • is_current (BooleanField) – Is current

  • content_path (CharField) – Content path. Relative path to content directory under assets/legal/, e.g. “tos/v1.0”

Reverse relationships:

Parameters:

responses (Reverse ForeignKey from LegalDocumentResponse) – All responses of this legal document (related name of document)

class DocumentType(*values)[source]

Bases: TextChoices

save(*args, **kwargs)[source]

Save the current instance. Override this in a subclass if you want to control the saving process.

The ‘force_insert’ and ‘force_update’ parameters can be used to insist that the “save” must be an SQL insert or update (or equivalent for non-SQL backends), respectively. Normally, they should not be set.

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

exception NotUpdated

Bases: ObjectNotUpdated, DatabaseError

class thunderbird_accounts.legal.models.LegalDocumentResponse(*args, **kwargs)[source]

Bases: BaseModel

Audit log of user responses (accept/decline) to legal documents.

Parameters:
  • uuid (UUIDField) – Primary key: Uuid

  • created_at (DateTimeField) – Created at

  • updated_at (DateTimeField) – Updated at

  • action (CharField) – Action

  • source_context (CharField) – Source context. Where the user responded from, e.g. “sign-up”, “dashboard”, “thundermail”

Relationship fields:

Parameters:
  • user (ForeignKey to User) – User (related name: legal_responses)

  • document (ForeignKey to LegalDocument) – Document (related name: responses)

class Action(*values)[source]

Bases: TextChoices

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

exception NotUpdated

Bases: ObjectNotUpdated, DatabaseError