djblets.privacy.models¶
Database models for privacy-related data storage.
-
class
StoredConsentData
(*args, **kwargs)[source]¶ Bases:
django.db.models.base.Model
Stored information about a user’s current and past consent decisions.
This tracks what parts of a product a user has consented to, and how those decisions have changed in the past. The model is not meant to be queried directly by applications, but rather used behind the scenes by
DatabaseConsentTracker
.Entries are associated with a user in the database (when available), but are also associated with a piece of identifying data for the purposes of privacy auditing. The identifying data (stored in
audit_identifier
) can be erased at any point without impacting the model, and can also store encrypted values if needed by the application.-
user
[source]¶ Accessor to the related object on the forward side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
restaurant.place
is aForwardOneToOneDescriptor
instance.
-
audit_identifier
[source]¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
time_added
[source]¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
last_updated
[source]¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
consent_grants
[source]¶ The current consent grant state of each consent-tracking item.
This is in the form of:
{ "<consent_requirement_id>": bool, ... }
Each boolean indicates if consent is granted or denied.
-
audit_trail
[source]¶ An audit trail of each consent-tracking decision.
This is in the form of:
{ "<consent_requirement_id>": [ { "identifier": string, "granted": bool, "timestamp": UTC datetime, "source": string, "memo": string, }, ... ], ... }
-
__unicode__
()[source]¶ Return a string representation of the object.
Returns: The string representation of the object. Return type: unicode
-