aiida.backends.sqlalchemy.models package¶
Module to define the database models for the SqlAlchemy backend.
Submodules¶
-
class
aiida.backends.sqlalchemy.models.authinfo.
DbAuthInfo
(*args, **kwargs)[source]¶ Bases:
sqlalchemy.ext.declarative.api.Model
-
__init__
(*args, **kwargs)¶
-
__mapper__
= <Mapper at 0x7ffba80e1bd0; DbAuthInfo>¶
-
__module__
= 'aiida.backends.sqlalchemy.models.authinfo'¶
-
__table__
= Table('db_dbauthinfo', MetaData(bind=None), Column('id', Integer(), table=<db_dbauthinfo>, primary_key=True, nullable=False), Column('aiidauser_id', Integer(), ForeignKey('db_dbuser.id'), table=<db_dbauthinfo>), Column('dbcomputer_id', Integer(), ForeignKey('db_dbcomputer.id'), table=<db_dbauthinfo>), Column('metadata', JSONB(astext_type=Text()), table=<db_dbauthinfo>), Column('auth_params', JSONB(astext_type=Text()), table=<db_dbauthinfo>), Column('enabled', Boolean(), table=<db_dbauthinfo>, default=ColumnDefault(True)), schema=None)¶
-
__table_args__
= (UniqueConstraint(Column('aiidauser_id', Integer(), ForeignKey('db_dbuser.id'), table=<db_dbauthinfo>), Column('dbcomputer_id', Integer(), ForeignKey('db_dbcomputer.id'), table=<db_dbauthinfo>)),)¶
-
__tablename__
= 'db_dbauthinfo'¶
-
_metadata
¶
-
_sa_class_manager
= {'_metadata': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'aiidauser': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'aiidauser_id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'auth_params': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'dbcomputer': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'dbcomputer_id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'enabled': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>}¶
-
aiidauser
¶
-
aiidauser_id
¶
-
auth_params
¶
-
dbcomputer
¶
-
dbcomputer_id
¶
-
enabled
¶
-
id
¶
-
-
class
aiida.backends.sqlalchemy.models.base.
Model
[source]¶ Bases:
object
-
__dict__
= dict_proxy({'__module__': 'aiida.backends.sqlalchemy.models.base', 'session': <aiida.backends.sqlalchemy.models.base._SessionProperty object>, '__dict__': <attribute '__dict__' of 'Model' objects>, 'query': <aiida.backends.sqlalchemy.models.base._QueryProperty object>, 'save': <function save>, '__weakref__': <attribute '__weakref__' of 'Model' objects>, '__doc__': None, 'delete': <function delete>})¶
-
__module__
= 'aiida.backends.sqlalchemy.models.base'¶
-
__weakref__
¶ list of weak references to the object (if defined)
-
delete
(commit=True)[source]¶ Emulate the behavior of Django’s delete() method
Parameters: commit – whether to do a commit or just remover from the session
-
query
= None¶
-
save
(commit=True)[source]¶ Emulate the behavior of Django’s save() method
Parameters: commit – whether to do a commit or just add to the session Returns: the SQLAlchemy instance
-
session
¶
-
-
class
aiida.backends.sqlalchemy.models.base.
_AiidaQuery
(*args, **kwargs)[source]¶ Bases:
sqlalchemy.orm.query.Query
-
__module__
= 'aiida.backends.sqlalchemy.models.base'¶
-
-
class
aiida.backends.sqlalchemy.models.base.
_QueryProperty
(query_class=<class 'sqlalchemy.orm.query.Query'>)[source]¶ Bases:
object
-
__dict__
= dict_proxy({'__module__': 'aiida.backends.sqlalchemy.models.base', '__dict__': <attribute '__dict__' of '_QueryProperty' objects>, '__weakref__': <attribute '__weakref__' of '_QueryProperty' objects>, '__doc__': None, '__init__': <function __init__>, '__get__': <function __get__>})¶
-
__init__
(query_class=<class 'sqlalchemy.orm.query.Query'>)[source]¶ x.__init__(…) initializes x; see help(type(x)) for signature
-
__module__
= 'aiida.backends.sqlalchemy.models.base'¶
-
__weakref__
¶ list of weak references to the object (if defined)
-
-
class
aiida.backends.sqlalchemy.models.base.
_SessionProperty
[source]¶ Bases:
object
-
__dict__
= dict_proxy({'__dict__': <attribute '__dict__' of '_SessionProperty' objects>, '__module__': 'aiida.backends.sqlalchemy.models.base', '__weakref__': <attribute '__weakref__' of '_SessionProperty' objects>, '__doc__': None, '__get__': <function __get__>})¶
-
__module__
= 'aiida.backends.sqlalchemy.models.base'¶
-
__weakref__
¶ list of weak references to the object (if defined)
-
-
class
aiida.backends.sqlalchemy.models.comment.
DbComment
(*args, **kwargs)[source]¶ Bases:
sqlalchemy.ext.declarative.api.Model
-
__init__
(*args, **kwargs)¶
-
__mapper__
= <Mapper at 0x7ffba8278550; DbComment>¶
-
__module__
= 'aiida.backends.sqlalchemy.models.comment'¶
-
__table__
= Table('db_dbcomment', MetaData(bind=None), Column('id', Integer(), table=<db_dbcomment>, primary_key=True, nullable=False), Column('uuid', UUID(as_uuid=True), table=<db_dbcomment>, default=ColumnDefault(<function get_new_uuid>)), Column('dbnode_id', Integer(), ForeignKey('db_dbnode.id'), table=<db_dbcomment>), Column('ctime', DateTime(timezone=True), table=<db_dbcomment>, default=ColumnDefault(<function now>)), Column('mtime', DateTime(timezone=True), table=<db_dbcomment>, onupdate=ColumnDefault(<function now>), default=ColumnDefault(<function now>)), Column('user_id', Integer(), ForeignKey('db_dbuser.id'), table=<db_dbcomment>), Column('content', Text(), table=<db_dbcomment>), schema=None)¶
-
__tablename__
= 'db_dbcomment'¶
-
_sa_class_manager
= {'content': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'ctime': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'dbnode': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'dbnode_id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'mtime': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'user': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'user_id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'uuid': <sqlalchemy.orm.attributes.InstrumentedAttribute object>}¶
-
content
¶
-
ctime
¶
-
dbnode
¶
-
dbnode_id
¶
-
id
¶
-
mtime
¶
-
user
¶
-
user_id
¶
-
uuid
¶
-
-
class
aiida.backends.sqlalchemy.models.computer.
DbComputer
(*args, **kwargs)[source]¶ Bases:
sqlalchemy.ext.declarative.api.Model
-
__init__
(*args, **kwargs)¶
-
__mapper__
= <Mapper at 0x7ffba7da1950; DbComputer>¶
-
__module__
= 'aiida.backends.sqlalchemy.models.computer'¶
-
__table__
= Table('db_dbcomputer', MetaData(bind=None), Column('id', Integer(), table=<db_dbcomputer>, primary_key=True, nullable=False), Column('uuid', UUID(as_uuid=True), table=<db_dbcomputer>, default=ColumnDefault(<function get_new_uuid>)), Column('name', String(length=255), table=<db_dbcomputer>, nullable=False), Column('hostname', String(length=255), table=<db_dbcomputer>), Column('description', Text(), table=<db_dbcomputer>), Column('enabled', Boolean(), table=<db_dbcomputer>), Column('transport_type', String(length=255), table=<db_dbcomputer>), Column('scheduler_type', String(length=255), table=<db_dbcomputer>), Column('transport_params', JSONB(astext_type=Text()), table=<db_dbcomputer>), Column('metadata', JSONB(astext_type=Text()), table=<db_dbcomputer>), schema=None)¶
-
__tablename__
= 'db_dbcomputer'¶
-
_metadata
¶
-
_sa_class_manager
= {'_metadata': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'authinfos': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'dbnodes': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'description': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'enabled': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'hostname': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'name': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'scheduler_type': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'transport_params': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'transport_type': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'uuid': <sqlalchemy.orm.attributes.InstrumentedAttribute object>}¶
-
authinfos
¶
-
dbnodes
¶
-
description
¶
-
enabled
¶
-
classmethod
get_dbcomputer
(computer)[source]¶ Return a DbComputer from its name (or from another Computer or DbComputer instance)
-
hostname
¶
-
id
¶
-
name
¶
-
pk
¶
-
scheduler_type
¶
-
transport_params
¶
-
transport_type
¶
-
uuid
¶
-
-
class
aiida.backends.sqlalchemy.models.group.
DbGroup
(**kwargs)[source]¶ Bases:
sqlalchemy.ext.declarative.api.Model
-
__init__
(**kwargs)¶ A simple constructor that allows initialization from kwargs.
Sets attributes on the constructed instance using the names and values in
kwargs
.Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.
-
__mapper__
= <Mapper at 0x7ffba7ed2150; DbGroup>¶
-
__module__
= 'aiida.backends.sqlalchemy.models.group'¶
-
__table__
= Table('db_dbgroup', MetaData(bind=None), Column('id', Integer(), table=<db_dbgroup>, primary_key=True, nullable=False), Column('uuid', UUID(as_uuid=True), table=<db_dbgroup>, default=ColumnDefault(<function get_new_uuid>)), Column('label', String(length=255), table=<db_dbgroup>), Column('type_string', String(length=255), table=<db_dbgroup>, default=ColumnDefault('')), Column('time', DateTime(timezone=True), table=<db_dbgroup>, default=ColumnDefault(<function now>)), Column('description', Text(), table=<db_dbgroup>), Column('user_id', Integer(), ForeignKey('db_dbuser.id'), table=<db_dbgroup>), schema=None)¶
-
__table_args__
= (UniqueConstraint(Column('label', String(length=255), table=<db_dbgroup>), Column('type_string', String(length=255), table=<db_dbgroup>, default=ColumnDefault(''))),)¶
-
__tablename__
= 'db_dbgroup'¶
-
_sa_class_manager
= {'dbnodes': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'description': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'label': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'time': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'type_string': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'user': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'user_id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'uuid': <sqlalchemy.orm.attributes.InstrumentedAttribute object>}¶
-
dbnodes
¶
-
description
¶
-
id
¶
-
label
¶
-
pk
¶
-
time
¶
-
type_string
¶
-
user
¶
-
user_id
¶
-
uuid
¶
-
-
class
aiida.backends.sqlalchemy.models.log.
DbLog
(time, loggername, levelname, dbnode_id, uuid=None, message=None, metadata=None)[source]¶ Bases:
sqlalchemy.ext.declarative.api.Model
-
__init__
(time, loggername, levelname, dbnode_id, uuid=None, message=None, metadata=None)¶
-
__mapper__
= <Mapper at 0x7ffba74b5750; DbLog>¶
-
__module__
= 'aiida.backends.sqlalchemy.models.log'¶
-
__table__
= Table('db_dblog', MetaData(bind=None), Column('id', Integer(), table=<db_dblog>, primary_key=True, nullable=False), Column('uuid', UUID(as_uuid=True), table=<db_dblog>, default=ColumnDefault(<function get_new_uuid>)), Column('time', DateTime(timezone=True), table=<db_dblog>, default=ColumnDefault(<function now>)), Column('loggername', String(length=255), table=<db_dblog>), Column('levelname', String(length=255), table=<db_dblog>), Column('dbnode_id', Integer(), ForeignKey('db_dbnode.id'), table=<db_dblog>, nullable=False), Column('message', Text(), table=<db_dblog>), Column('metadata', JSONB(astext_type=Text()), table=<db_dblog>), schema=None)¶
-
__tablename__
= 'db_dblog'¶
-
_metadata
¶
-
_sa_class_manager
= {'_metadata': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'dbnode': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'dbnode_id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'levelname': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'loggername': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'message': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'time': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'uuid': <sqlalchemy.orm.attributes.InstrumentedAttribute object>}¶
-
dbnode
¶
-
dbnode_id
¶
-
id
¶
-
levelname
¶
-
loggername
¶
-
message
¶
-
time
¶
-
uuid
¶
-
-
class
aiida.backends.sqlalchemy.models.node.
DbLink
(**kwargs)[source]¶ Bases:
sqlalchemy.ext.declarative.api.Model
-
__init__
(**kwargs)¶ A simple constructor that allows initialization from kwargs.
Sets attributes on the constructed instance using the names and values in
kwargs
.Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.
-
__mapper__
= <Mapper at 0x7ffba75420d0; DbLink>¶
-
__module__
= 'aiida.backends.sqlalchemy.models.node'¶
-
__table__
= Table('db_dblink', MetaData(bind=None), Column('id', Integer(), table=<db_dblink>, primary_key=True, nullable=False), Column('input_id', Integer(), ForeignKey('db_dbnode.id'), table=<db_dblink>), Column('output_id', Integer(), ForeignKey('db_dbnode.id'), table=<db_dblink>), Column('label', String(length=255), table=<db_dblink>, nullable=False), Column('type', String(length=255), table=<db_dblink>), schema=None)¶
-
__table_args__
= ()¶
-
__tablename__
= 'db_dblink'¶
-
_sa_class_manager
= {'id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'input': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'input_id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'label': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'output': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'output_id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'type': <sqlalchemy.orm.attributes.InstrumentedAttribute object>}¶
-
id
¶
-
input
¶
-
input_id
¶
-
label
¶
-
output
¶
-
output_id
¶
-
type
¶
-
-
class
aiida.backends.sqlalchemy.models.node.
DbNode
(*args, **kwargs)[source]¶ Bases:
sqlalchemy.ext.declarative.api.Model
-
__init__
(*args, **kwargs)¶
-
__mapper__
= <Mapper at 0x7ffba7300890; DbNode>¶
-
__module__
= 'aiida.backends.sqlalchemy.models.node'¶
-
__table__
= Table('db_dbnode', MetaData(bind=None), Column('id', Integer(), table=<db_dbnode>, primary_key=True, nullable=False), Column('uuid', UUID(as_uuid=True), table=<db_dbnode>, default=ColumnDefault(<function get_new_uuid>)), Column('node_type', String(length=255), table=<db_dbnode>), Column('process_type', String(length=255), table=<db_dbnode>), Column('label', String(length=255), table=<db_dbnode>, default=ColumnDefault('')), Column('description', Text(), table=<db_dbnode>, default=ColumnDefault('')), Column('ctime', DateTime(timezone=True), table=<db_dbnode>, default=ColumnDefault(<function now>)), Column('mtime', DateTime(timezone=True), table=<db_dbnode>, onupdate=ColumnDefault(<function now>), default=ColumnDefault(<function now>)), Column('nodeversion', Integer(), table=<db_dbnode>, default=ColumnDefault(1)), Column('public', Boolean(), table=<db_dbnode>, default=ColumnDefault(False)), Column('attributes', JSONB(astext_type=Text()), table=<db_dbnode>), Column('extras', JSONB(astext_type=Text()), table=<db_dbnode>), Column('dbcomputer_id', Integer(), ForeignKey('db_dbcomputer.id'), table=<db_dbnode>), Column('user_id', Integer(), ForeignKey('db_dbuser.id'), table=<db_dbnode>, nullable=False), schema=None)¶
-
__tablename__
= 'db_dbnode'¶
-
_sa_class_manager
= {'attributes': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'ctime': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'dbcomments': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'dbcomputer': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'dbcomputer_id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'dbgroups': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'dblogs': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'description': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'extras': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'inputs_q': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'label': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'mtime': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'node_type': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'nodeversion': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'outputs_q': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'process_type': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'public': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'user': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'user_id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'uuid': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'workflow_step': <sqlalchemy.orm.attributes.InstrumentedAttribute object>}¶
-
attributes
¶
-
computer_name
¶ Returns: the name of the computer at a class level (i.e. in the database)
-
ctime
¶
-
dbcomments
¶
-
dbcomputer
¶
-
dbcomputer_id
¶
-
dbgroups
¶
-
dblogs
¶
-
description
¶
-
extras
¶
-
get_simple_name
(invalid_result=None)[source]¶ Return a string with the last part of the type name.
If the type is empty, use ‘Node’. If the type is invalid, return the content of the input variable
invalid_result
.Parameters: invalid_result – The value to be returned if the node type is not recognized.
-
id
¶
-
inputs
¶
-
inputs_q
¶
-
label
¶
-
mtime
¶
-
node_type
¶
-
nodeversion
¶
-
outputs
¶
-
outputs_q
¶
-
pk
¶
-
process_type
¶
-
public
¶
-
user
¶
-
user_email
¶ Returns: the email of the user at a class level (i.e. in the database)
-
user_id
¶
-
uuid
¶
-
workflow_step
¶
-
-
class
aiida.backends.sqlalchemy.models.settings.
DbSetting
(**kwargs)[source]¶ Bases:
sqlalchemy.ext.declarative.api.Model
-
__init__
(**kwargs)¶ A simple constructor that allows initialization from kwargs.
Sets attributes on the constructed instance using the names and values in
kwargs
.Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.
-
__mapper__
= <Mapper at 0x7ffba75ffed0; DbSetting>¶
-
__module__
= 'aiida.backends.sqlalchemy.models.settings'¶
-
__table__
= Table('db_dbsetting', MetaData(bind=None), Column('id', Integer(), table=<db_dbsetting>, primary_key=True, nullable=False), Column('key', String(length=255), table=<db_dbsetting>, nullable=False), Column('val', JSONB(astext_type=Text()), table=<db_dbsetting>, default=ColumnDefault({})), Column('description', String(length=255), table=<db_dbsetting>, nullable=False, default=ColumnDefault('')), Column('time', DateTime(timezone=True), table=<db_dbsetting>, onupdate=ColumnDefault(<function now>), default=ColumnDefault(<UTC>)), schema=None)¶
-
__table_args__
= (UniqueConstraint(Column('key', String(length=255), table=<db_dbsetting>, nullable=False)),)¶
-
__tablename__
= 'db_dbsetting'¶
-
_sa_class_manager
= {'description': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'key': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'time': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'val': <sqlalchemy.orm.attributes.InstrumentedAttribute object>}¶
-
description
¶
-
get_description
()[source]¶ This can be called on a given row and will get the corresponding description.
-
id
¶
-
key
¶
-
classmethod
set_value
(key, value, with_transaction=True, subspecifier_value=None, other_attribs={}, stop_if_existing=False)[source]¶
-
time
¶
-
val
¶
-
-
class
aiida.backends.sqlalchemy.models.user.
DbUser
(email, first_name='', last_name='', institution='', **kwargs)[source]¶ Bases:
sqlalchemy.ext.declarative.api.Model
-
__init__
(email, first_name='', last_name='', institution='', **kwargs)¶
-
__mapper__
= <Mapper at 0x7ffba747e310; DbUser>¶
-
__module__
= 'aiida.backends.sqlalchemy.models.user'¶
-
__table__
= Table('db_dbuser', MetaData(bind=None), Column('id', Integer(), table=<db_dbuser>, primary_key=True, nullable=False), Column('email', String(length=254), table=<db_dbuser>), Column('password', String(length=128), table=<db_dbuser>), Column('is_superuser', Boolean(), table=<db_dbuser>, nullable=False, default=ColumnDefault(False)), Column('first_name', String(length=254), table=<db_dbuser>), Column('last_name', String(length=254), table=<db_dbuser>), Column('institution', String(length=254), table=<db_dbuser>), Column('is_staff', Boolean(), table=<db_dbuser>, default=ColumnDefault(False)), Column('is_active', Boolean(), table=<db_dbuser>, default=ColumnDefault(False)), Column('last_login', DateTime(timezone=True), table=<db_dbuser>, default=ColumnDefault(<function now>)), Column('date_joined', DateTime(timezone=True), table=<db_dbuser>, default=ColumnDefault(<function now>)), schema=None)¶
-
__tablename__
= 'db_dbuser'¶
-
_sa_class_manager
= {'authinfos': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'date_joined': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'dbgroups': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'dbnodes': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'email': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'first_name': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'institution': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'is_active': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'is_staff': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'is_superuser': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'last_login': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'last_name': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'password': <sqlalchemy.orm.attributes.InstrumentedAttribute object>}¶
-
authinfos
¶
-
date_joined
¶
-
dbgroups
¶
-
dbnodes
¶
-
email
¶
-
first_name
¶
-
id
¶
-
institution
¶
-
is_active
¶
-
is_staff
¶
-
is_superuser
¶
-
last_login
¶
-
last_name
¶
-
password
¶
-
-
aiida.backends.sqlalchemy.models.utils.
get_value_of_sub_field
(key, original_get_value)[source]¶ Get the value that corresponds to sub-fields of dictionaries stored in a JSON. For example, if there is a dictionary {‘b’: ‘c’} stored as value of the key ‘a’ value ‘a’ :param key: The key that can be simple, a string, or complex, a set of keys separated by the separator value. :param original_get_value: The function that should be called to get the original value (which can be a dictionary too). :return: The value that correspond to the complex (or not) key. :raise aiida.common.NotExistent: If the key doesn’t correspond to a value
-
aiida.backends.sqlalchemy.models.utils.
validate_key
(key)[source]¶ Validate the key string to check if it is valid (e.g., if it does not contain the separator symbol.).
Returns: None if the key is valid Raises: aiida.common.ValidationError – if the key is not valid
Issue 2380 will take care of dropping this model, which will have to be accompanied by a migration.
-
class
aiida.backends.sqlalchemy.models.workflow.
DbWorkflow
(*args, **kwargs)[source]¶ Bases:
sqlalchemy.ext.declarative.api.Model
-
__init__
(*args, **kwargs)¶
-
__mapper__
= <Mapper at 0x7ffba7439690; DbWorkflow>¶
-
__module__
= 'aiida.backends.sqlalchemy.models.workflow'¶
-
__table__
= Table('db_dbworkflow', MetaData(bind=None), Column('id', Integer(), table=<db_dbworkflow>, primary_key=True, nullable=False), Column('uuid', UUID(as_uuid=True), table=<db_dbworkflow>, default=ColumnDefault(<function get_new_uuid>)), Column('ctime', DateTime(timezone=True), table=<db_dbworkflow>, default=ColumnDefault(<function now>)), Column('mtime', DateTime(timezone=True), table=<db_dbworkflow>, onupdate=ColumnDefault(<function now>), default=ColumnDefault(<function now>)), Column('user_id', Integer(), ForeignKey('db_dbuser.id'), table=<db_dbworkflow>), Column('label', String(length=255), table=<db_dbworkflow>), Column('description', Text(), table=<db_dbworkflow>), Column('nodeversion', Integer(), table=<db_dbworkflow>), Column('lastsyncedversion', Integer(), table=<db_dbworkflow>), Column('state', ChoiceType(length=255), table=<db_dbworkflow>, default=ColumnDefault(u'INITIALIZED')), Column('report', Text(), table=<db_dbworkflow>), Column('module', Text(), table=<db_dbworkflow>), Column('module_class', Text(), table=<db_dbworkflow>), Column('script_path', Text(), table=<db_dbworkflow>), Column('script_md5', String(length=255), table=<db_dbworkflow>), schema=None)¶
-
__tablename__
= 'db_dbworkflow'¶
-
_sa_class_manager
= {'ctime': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'data': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'description': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'label': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'lastsyncedversion': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'module': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'module_class': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'mtime': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'nodeversion': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'parent_workflow_step': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'report': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'script_md5': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'script_path': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'state': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'steps': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'user': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'user_id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'uuid': <sqlalchemy.orm.attributes.InstrumentedAttribute object>}¶
-
aiida_query
= <aiida.backends.sqlalchemy.models.base._AiidaQuery object>¶
-
ctime
¶
-
data
¶
-
description
¶
-
id
¶
-
is_subworkflow
()[source]¶ Return True if this is a subworkflow, False if it is a root workflow, launched by the user.
-
label
¶
-
lastsyncedversion
¶
-
module
¶
-
module_class
¶
-
mtime
¶
-
nodeversion
¶
-
parent_workflow_step
¶
-
pk
¶
-
report
¶
-
script_md5
¶
-
script_path
¶
-
state
¶
-
steps
¶
-
user
¶
-
user_id
¶
-
uuid
¶
-
-
class
aiida.backends.sqlalchemy.models.workflow.
DbWorkflowData
(**kwargs)[source]¶ Bases:
sqlalchemy.ext.declarative.api.Model
-
__init__
(**kwargs)¶ A simple constructor that allows initialization from kwargs.
Sets attributes on the constructed instance using the names and values in
kwargs
.Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.
-
__mapper__
= <Mapper at 0x7ffba743b290; DbWorkflowData>¶
-
__module__
= 'aiida.backends.sqlalchemy.models.workflow'¶
-
__table__
= Table('db_dbworkflowdata', MetaData(bind=None), Column('id', Integer(), table=<db_dbworkflowdata>, primary_key=True, nullable=False), Column('parent_id', Integer(), ForeignKey('db_dbworkflow.id'), table=<db_dbworkflowdata>), Column('name', String(length=255), table=<db_dbworkflowdata>), Column('time', DateTime(timezone=True), table=<db_dbworkflowdata>, default=ColumnDefault(<function now>)), Column('data_type', String(length=255), table=<db_dbworkflowdata>, default=ColumnDefault(u'PARAMETER')), Column('value_type', String(length=255), table=<db_dbworkflowdata>, default=ColumnDefault(u'NONE')), Column('json_value', Text(), table=<db_dbworkflowdata>), Column('aiida_obj_id', Integer(), ForeignKey('db_dbnode.id'), table=<db_dbworkflowdata>), schema=None)¶
-
__table_args__
= (UniqueConstraint(Column('parent_id', Integer(), ForeignKey('db_dbworkflow.id'), table=<db_dbworkflowdata>), Column('name', String(length=255), table=<db_dbworkflowdata>), Column('data_type', String(length=255), table=<db_dbworkflowdata>, default=ColumnDefault(u'PARAMETER'))),)¶
-
__tablename__
= 'db_dbworkflowdata'¶
-
_sa_class_manager
= {'aiida_obj': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'aiida_obj_id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'data_type': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'json_value': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'name': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'parent': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'parent_id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'time': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'value_type': <sqlalchemy.orm.attributes.InstrumentedAttribute object>}¶
-
aiida_obj
¶
-
aiida_obj_id
¶
-
data_type
¶
-
id
¶
-
json_value
¶
-
name
¶
-
parent
¶
-
parent_id
¶
-
time
¶
-
value_type
¶
-
-
class
aiida.backends.sqlalchemy.models.workflow.
DbWorkflowStep
(**kwargs)[source]¶ Bases:
sqlalchemy.ext.declarative.api.Model
-
__init__
(**kwargs)¶ A simple constructor that allows initialization from kwargs.
Sets attributes on the constructed instance using the names and values in
kwargs
.Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.
-
__mapper__
= <Mapper at 0x7ffba745f890; DbWorkflowStep>¶
-
__module__
= 'aiida.backends.sqlalchemy.models.workflow'¶
-
__table__
= Table('db_dbworkflowstep', MetaData(bind=None), Column('id', Integer(), table=<db_dbworkflowstep>, primary_key=True, nullable=False), Column('parent_id', Integer(), ForeignKey('db_dbworkflow.id'), table=<db_dbworkflowstep>), Column('user_id', Integer(), ForeignKey('db_dbuser.id'), table=<db_dbworkflowstep>), Column('name', String(length=255), table=<db_dbworkflowstep>), Column('time', DateTime(timezone=True), table=<db_dbworkflowstep>, default=ColumnDefault(<function now>)), Column('nextcall', String(length=255), table=<db_dbworkflowstep>, default=ColumnDefault('none')), Column('state', ChoiceType(length=255), table=<db_dbworkflowstep>, default=ColumnDefault(u'CREATED')), schema=None)¶
-
__table_args__
= (UniqueConstraint(Column('parent_id', Integer(), ForeignKey('db_dbworkflow.id'), table=<db_dbworkflowstep>), Column('name', String(length=255), table=<db_dbworkflowstep>)),)¶
-
__tablename__
= 'db_dbworkflowstep'¶
-
_sa_class_manager
= {'calculations': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'name': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'nextcall': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'parent': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'parent_id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'state': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'sub_workflows': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'time': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'user': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'user_id': <sqlalchemy.orm.attributes.InstrumentedAttribute object>}¶
-
calculations
¶
-
id
¶
-
name
¶
-
nextcall
¶
-
parent
¶
-
parent_id
¶
-
state
¶
-
sub_workflows
¶
-
time
¶
-
user
¶
-
user_id
¶
-
-
class
aiida.backends.sqlalchemy.models.workflow.
Enumerate
[source]¶ Bases:
frozenset
Custom implementation of enum.Enum.
-
__dict__
= dict_proxy({'__module__': 'aiida.backends.sqlalchemy.models.workflow', '__setattr__': <function __setattr__>, '__getattr__': <function __getattr__>, '__delattr__': <function __delattr__>, '__dict__': <attribute '__dict__' of 'Enumerate' objects>, '__doc__': 'Custom implementation of enum.Enum.'})¶
-
__module__
= 'aiida.backends.sqlalchemy.models.workflow'¶
-
-
class
aiida.backends.sqlalchemy.models.workflow.
WorkflowDataType
[source]¶ Bases:
aiida.backends.sqlalchemy.models.workflow.Enumerate
-
__module__
= 'aiida.backends.sqlalchemy.models.workflow'¶
-
-
class
aiida.backends.sqlalchemy.models.workflow.
WorkflowDataValueType
[source]¶ Bases:
aiida.backends.sqlalchemy.models.workflow.Enumerate
-
__module__
= 'aiida.backends.sqlalchemy.models.workflow'¶
-
-
class
aiida.backends.sqlalchemy.models.workflow.
WorkflowState
[source]¶ Bases:
aiida.backends.sqlalchemy.models.workflow.Enumerate
-
__module__
= 'aiida.backends.sqlalchemy.models.workflow'¶
-