Database Models¶
-
db.db¶ Instance of
flask_sqlalchemy.SQLAlchemythat the models are registered to.
Processing Operations¶
-
class
db.Operation(**kwargs)¶ flask_sqlalchemy.Modelrepresenting a processing operation-
id¶ Database id (int)
List of
Tagobjects associated with the operation
-
versions¶ List of
OpVersionobjects representing versions of the operation. Does not include drafts. Ordered byOpVersion.date_introduced.
-
-
class
db.Tag(**kwargs)¶ flask_sqlalchemy.Modelrepresenting a tag forOperationobjects-
id¶ Database id (int)
-
label¶ Tag label displayed to the user
-
-
class
db.Contact(**kwargs)¶ flask_sqlalchemy.Modelrepresenting a contact forOperationobjects-
id¶ Database id (int)
-
name¶ Display name of the contact. Could be a real name consisting of given and surname or a generic role name, must not be empty.
-
role¶ Display name of the contact’s role in the organisation. May be empty if no role is specified.
-
email¶ Contact’s email address. May be empty or a arbitrary string.
-
phone¶ Contact’s phone number. May be empty or a arbitrary string.
-
address¶ Contact’s office address. May be empty or a multi-line string.
-
-
class
db.OpVersion(**kwargs)¶ flask_sqlalchemy.Modelthat represents versions of andb.Operation-
id¶ Database id (int)
-
operation¶ Corresponding
db.Operation
-
data_categories¶ List of
OpVerCategoryobjects representing the proccessed data categories and affected subjects
-
date_introduced¶ datetimeobject representing the time when the version was activated orNoneif it is a draft
-
date_redeemed¶ datetimeobject representing the time when the version was redeemed orNoneif it is either active or a draft
-
title¶ Operation display name. Must not be empty.
-
description¶ Human-readable and short description. Must be a string but may be empty.
-
toms¶ Technical and organisational measures applied to ensure the protection of the subject’s data protection rights
-
reasons¶ Set of
db.LegalReasonenum members (seeEncodedEnumSet)
-
external_controllers¶ Set of strings representing the names of external entities that are jointly responsible for the processing operation
The names must not contain commas (“,”), see
EncodedTokenSet.
-
property
subjects¶ Read-only view summarizing the
subjectof alldata_categoriesas asetofstrobjects.Cannot be used in queries.
-
property
categories¶ Read-only view summarizing the
nameof alldata_categoriesas asetofstrobjects.Cannot be used in queries.
-
property
accessors¶ Read-only view summarizing the
accessorsof alldata_categoriesas asetofstrobjects.Cannot be used in queries.
-
property
recipients¶ Read-only view summarizing the
recipientsof alldata_categoriesas asetofstrobjects.Cannot be used in queries.
-
-
class
db.OpVerCategory(**kwargs)¶ flask_sqlalchemy.Modelthat represents a data category of adb.OpVersionobject-
id¶ Database id (int)
-
name¶ Data category name. Must not be empty. Should only name a single category.
-
subject¶
-
limit¶
-
is_special¶
-
accessors¶
-
recipients¶
-
Custom Column Types¶
-
class
db.EncodedEnumSet(base_enum)¶ TypeDecoratorto storesetofEnummembers in a singleStringcolumn- Parameters
base_enum (Enum) – The enum whose members shall be stored
To work properly, columns must be defined using a
MutableSet:mycol = Column(MutableSet.as_mutable(EncodedEnumSet(MyEnum))
Values are encoded as a comma-separeted list of enum member values.
Assinging sets containing non-member items or adding such items will raise a
ValueErrorexception. Equally, unknown values in the database will raise aValueErrorexception upon accesss.Note
When members of
base_enumare added or removed, database migrations must be performed carefully to avoid incompatabilities. It is not recommended to remove members of thebase_enum.
-
class
db.EncodedTokenSet(*args, **kwargs)¶ TypeDecoratorto storesetofstrobjects in a singleTextcolumnTo work properly, columns must be defined using a
MutableSet:Column(MutableSet.as_mutable(EncodedTokenSet)
Values are encoded as a comma-separeted list of the set items. Therefore items must not include commas (“,”)!
Assinging sets containing invalid strings or adding such strings will raise a
ValueErrorexception.