simdb.database.models.watcher module

class simdb.database.models.watcher.Watcher(username, email, notification)[source]

Bases: Base

Class to represent people watching simulations for updates.

NOTIFICATION_CHOICES : Final[Dict[Any, str]] = {Notification.ALL: 'A', Notification.OBSOLESCENCE: 'O', Notification.REVISION: 'R', Notification.VALIDATION: 'V'}
data(recurse: bool = False) dict[str, str][source]

Serialise the Watcher.

Parameters:
recurse: bool = False

If True also serialise any contained models, otherwise only serialise simple fields.

Returns:

The serialised data.

email
classmethod from_data(data: dict) Watcher[source]

Create a Model from serialised data.

Parameters:
data: dict

Serialised model data.

Returns:

The created model.

id
notification
to_model() WatcherData[source]
username
validate_email(key, address)[source]