vial.model.db module¶
-
class
vial.model.db.
BaseMixin
[source]¶ Bases:
object
Base class providing usefull mixin functionality.
-
createtime
= Column(None, DateTime(), table=None, default=ColumnDefault(<function datetime.utcnow>))¶
-
id
= Column(None, Integer(), table=None, primary_key=True, nullable=False)¶
-
-
class
vial.model.db.
GroupModel
(**kwargs)[source]¶ Bases:
sqlalchemy.ext.declarative.api.Base
,vial.model.db.BaseMixin
Class representing group objects within the SQL database mapped to
groups
table.-
children
¶
-
createtime
¶
-
description
¶
-
enabled
¶
-
classmethod
from_dict
(structure, defaults=None)[source]¶ Convenience method for creating
mydojo.db.GroupModel
object fromdict
objects.
-
id
¶
-
managers
¶
-
members
¶
-
members_wanted
¶
-
name
¶
-
parent_id
¶
-
-
class
vial.model.db.
ItemChangeLogModel
(**kwargs)[source]¶ Bases:
sqlalchemy.ext.declarative.api.Base
,vial.model.db.BaseMixin
Class representing item changelog records within the SQL database mapped to
changelogs_items
table.-
after
¶
-
before
¶
-
calculate_diff
()[source]¶ Calculate difference between internal
before
andafter
attributes and store it internally intodiff
attribute.
-
createtime
¶
-
diff
¶
-
endpoint
¶
-
id
¶
-
model
¶
-
model_id
¶
-
module
¶
-
operation
¶
-
-
class
vial.model.db.
UserModel
(**kwargs)[source]¶ Bases:
sqlalchemy.ext.declarative.api.Base
,vial.model.db.BaseMixin
Class representing user objects within the SQL database mapped to
users
table.-
apikey
¶
-
changelogs
¶
-
check_password
(password_plain)[source]¶ Check given plaintext password agains internal password hash.
-
createtime
¶
-
email
¶
-
enabled
¶
-
classmethod
from_dict
(structure, defaults=None)[source]¶ Convenience method for creating
mydojo.db.UserModel
object fromdict
objects.
-
fullname
¶
-
has_role
(role)[source]¶ Returns
True
if the user identifies with the specified role.- Parameters
role (str) – A role name.
-
id
¶
-
property
is_active
¶ Mandatory interface required by the
flask_login
extension.
-
property
is_anonymous
¶ Mandatory interface required by the
flask_login
extension.
-
property
is_authenticated
¶ Mandatory interface required by the
flask_login
extension.
-
locale
¶
-
login
¶
-
logintime
¶
-
managements
¶
-
memberships
¶
-
memberships_wanted
¶
-
password
¶
-
roles
¶
-
set_password
(password_plain)[source]¶ Generate and set password hash from given plain text password.
-
timezone
¶
-
-
vial.model.db.
dictdiff
(dict_obj_a, dict_obj_b)[source]¶ Calculate the difference between two model objects given as dicts.