aiida.backends.djsite.querybuilder_django package¶
Submodules¶
The dummy model encodes the model defined by django in backends.djsite using SQLAlchemy. This is done to query the database with more performant ORM of SA.
-
class
aiida.backends.djsite.querybuilder_django.dummy_model.
DbAttribute
(**kwargs)[source]¶ Bases:
sqlalchemy.ext.declarative.api.Base
-
__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 0x7f8425313f10; DbAttribute>¶
-
__module__
= 'aiida.backends.djsite.querybuilder_django.dummy_model'¶
-
__table__
= Table('db_dbattribute', MetaData(bind=None), Column('id', Integer(), table=<db_dbattribute>, primary_key=True, nullable=False), Column('dbnode_id', Integer(), ForeignKey('db_dbnode.id'), table=<db_dbattribute>), Column('key', String(length=255), table=<db_dbattribute>), Column('datatype', String(length=10), table=<db_dbattribute>), Column('tval', String(), table=<db_dbattribute>, default=ColumnDefault('')), Column('fval', Float(), table=<db_dbattribute>), Column('ival', Integer(), table=<db_dbattribute>), Column('bval', Boolean(), table=<db_dbattribute>), Column('dval', DateTime(), table=<db_dbattribute>), schema=None)¶
-
__tablename__
= 'db_dbattribute'¶
-
_sa_class_manager
= {'bval': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f8425342350>, 'datatype': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f8425342050>, 'dbnode_id': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f842540de90>, 'dval': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f8425342410>, 'fval': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f84253421d0>, 'id': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f842540dd10>, 'ival': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f8425342290>, 'key': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f842540df50>, 'tval': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f8425342110>}¶
-
bval
¶
-
datatype
¶
-
dbnode_id
¶
-
dval
¶
-
fval
¶
-
id
¶
-
ival
¶
-
key
¶
-
tval
¶
-
-
class
aiida.backends.djsite.querybuilder_django.dummy_model.
DbCalcState
(**kwargs)[source]¶ Bases:
sqlalchemy.ext.declarative.api.Base
-
__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 0x7f8425313710; DbCalcState>¶
-
__module__
= 'aiida.backends.djsite.querybuilder_django.dummy_model'¶
-
__table__
= Table('db_dbcalcstate', MetaData(bind=None), Column('id', Integer(), table=<db_dbcalcstate>, primary_key=True, nullable=False), Column('state', String(length=255), table=<db_dbcalcstate>), Column('time', DateTime(timezone=True), table=<db_dbcalcstate>, default=ColumnDefault(<function <lambda>>)), Column('dbnode_id', Integer(), ForeignKey('db_dbnode.id'), table=<db_dbcalcstate>), schema=None)¶
-
__table_args__
= (UniqueConstraint(Column('dbnode_id', Integer(), ForeignKey('db_dbnode.id'), table=<db_dbcalcstate>), Column('state', String(length=255), table=<db_dbcalcstate>)),)¶
-
__tablename__
= 'db_dbcalcstate'¶
-
_sa_class_manager
= {'dbnode': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f842540d890>, 'dbnode_id': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f842540dc50>, 'id': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f842540da10>, 'state': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f842540dad0>, 'time': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f842540db90>}¶
-
dbnode
¶
-
dbnode_id
¶
-
id
¶
-
state
¶
-
time
¶
-
-
class
aiida.backends.djsite.querybuilder_django.dummy_model.
DbComputer
(**kwargs)[source]¶ Bases:
sqlalchemy.ext.declarative.api.Base
-
__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 0x7f8425390510; DbComputer>¶
-
__module__
= 'aiida.backends.djsite.querybuilder_django.dummy_model'¶
-
__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 <lambda>>)), 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', String(length=255), table=<db_dbcomputer>), Column('metadata', String(length=255), table=<db_dbcomputer>, default=ColumnDefault('{}')), schema=None)¶
-
__tablename__
= 'db_dbcomputer'¶
-
_metadata
¶
-
_sa_class_manager
= {'_metadata': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f8425342c50>, 'description': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f84254c2e30>, 'enabled': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f8425460650>, 'hostname': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f8425475890>, 'id': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f8425342dd0>, 'name': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f8425475a70>, 'scheduler_type': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f8425435710>, 'transport_params': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f84254356b0>, 'transport_type': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f8425435a10>, 'uuid': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f8425342e90>}¶
-
description
¶
-
enabled
¶
-
hostname
¶
-
id
¶
-
name
¶
-
scheduler_type
¶
-
transport_params
¶
-
transport_type
¶
-
uuid
¶
-
-
class
aiida.backends.djsite.querybuilder_django.dummy_model.
DbExtra
(**kwargs)[source]¶ Bases:
sqlalchemy.ext.declarative.api.Base
-
__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 0x7f8425336990; DbExtra>¶
-
__module__
= 'aiida.backends.djsite.querybuilder_django.dummy_model'¶
-
__table__
= Table('db_dbextra', MetaData(bind=None), Column('id', Integer(), table=<db_dbextra>, primary_key=True, nullable=False), Column('dbnode_id', Integer(), ForeignKey('db_dbnode.id'), table=<db_dbextra>), Column('key', String(length=255), table=<db_dbextra>), Column('datatype', String(length=10), table=<db_dbextra>), Column('tval', String(), table=<db_dbextra>, default=ColumnDefault('')), Column('fval', Float(), table=<db_dbextra>), Column('ival', Integer(), table=<db_dbextra>), Column('bval', Boolean(), table=<db_dbextra>), Column('dval', DateTime(), table=<db_dbextra>), schema=None)¶
-
__tablename__
= 'db_dbextra'¶
-
_sa_class_manager
= {'bval': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f8425342ad0>, 'datatype': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f84253427d0>, 'dbnode_id': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f8425342650>, 'dval': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f8425342b90>, 'fval': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f8425342950>, 'id': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f84253424d0>, 'ival': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f8425342a10>, 'key': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f8425342710>, 'tval': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f8425342890>}¶
-
bval
¶
-
datatype
¶
-
dbnode_id
¶
-
dval
¶
-
fval
¶
-
id
¶
-
ival
¶
-
key
¶
-
tval
¶
-
-
class
aiida.backends.djsite.querybuilder_django.dummy_model.
DbGroup
(**kwargs)[source]¶ Bases:
sqlalchemy.ext.declarative.api.Base
-
__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 0x7f84253a5790; DbGroup>¶
-
__module__
= 'aiida.backends.djsite.querybuilder_django.dummy_model'¶
-
__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 <lambda>>)), Column('name', String(length=255), table=<db_dbgroup>), Column('type', String(length=255), table=<db_dbgroup>, default=ColumnDefault('')), Column('time', DateTime(timezone=True), table=<db_dbgroup>, default=ColumnDefault(<function <lambda>>)), Column('description', Text(), table=<db_dbgroup>), Column('user_id', Integer(), ForeignKey('db_dbuser.id'), table=<db_dbgroup>), schema=None)¶
-
__table_args__
= (UniqueConstraint(Column('name', String(length=255), table=<db_dbgroup>), Column('type', String(length=255), table=<db_dbgroup>, default=ColumnDefault(''))),)¶
-
__tablename__
= 'db_dbgroup'¶
-
_sa_class_manager
= {'dbnodes': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f84253a3a10>, 'description': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f84253a3e90>, 'id': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f84253a3ad0>, 'name': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f84253a3c50>, 'time': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f84253a3dd0>, 'type': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f84253a3d10>, 'user': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f84253a3890>, 'user_id': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f84253a3f50>, 'uuid': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f84253a3b90>}¶
-
dbnodes
¶
-
description
¶
-
id
¶
-
name
¶
-
time
¶
-
type
¶
-
user
¶
-
user_id
¶
-
uuid
¶
-
-
class
aiida.backends.djsite.querybuilder_django.dummy_model.
DbLink
(**kwargs)[source]¶ Bases:
sqlalchemy.ext.declarative.api.Base
-
__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 0x7f8425403e90; DbLink>¶
-
__module__
= 'aiida.backends.djsite.querybuilder_django.dummy_model'¶
-
__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('type', String(length=255), table=<db_dblink>), Column('label', String(length=255), table=<db_dblink>, nullable=False), schema=None)¶
-
__tablename__
= 'db_dblink'¶
-
_sa_class_manager
= {'id': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f842540d470>, 'input': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f842540d230>, 'input_id': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f842540d530>, 'label': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f842540d770>, 'output': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f842540d3b0>, 'output_id': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f842540d5f0>, 'type': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f842540d6b0>}¶
-
id
¶
-
input
¶
-
input_id
¶
-
label
¶
-
output
¶
-
output_id
¶
-
type
¶
-
-
class
aiida.backends.djsite.querybuilder_django.dummy_model.
DbNode
(**kwargs)[source]¶ Bases:
sqlalchemy.ext.declarative.api.Base
-
__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 0x7f84253ac790; DbNode>¶
-
__module__
= 'aiida.backends.djsite.querybuilder_django.dummy_model'¶
-
__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 <lambda>>)), Column('type', String(length=255), table=<db_dbnode>), Column('label', String(length=255), table=<db_dbnode>), Column('description', Text(), table=<db_dbnode>), Column('ctime', DateTime(timezone=True), table=<db_dbnode>, default=ColumnDefault(<function <lambda>>)), Column('mtime', DateTime(timezone=True), table=<db_dbnode>, default=ColumnDefault(<function <lambda>>)), Column('dbcomputer_id', Integer(), ForeignKey('db_dbcomputer.id'), table=<db_dbnode>), Column('user_id', Integer(), ForeignKey('db_dbuser.id'), table=<db_dbnode>, nullable=False), Column('public', Boolean(), table=<db_dbnode>, default=ColumnDefault(False)), Column('nodeversion', Integer(), table=<db_dbnode>, default=ColumnDefault(1)), schema=None)¶
-
__tablename__
= 'db_dbnode'¶
-
_sa_class_manager
= {'attributes': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f84253af470>, 'ctime': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f84253afa70>, 'dbcomputer': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f84253af230>, 'dbcomputer_id': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f84253afbf0>, 'description': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f84253af9b0>, 'extras': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f84253af530>, 'id': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f84253af6b0>, 'label': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f84253af8f0>, 'mtime': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f84253afb30>, 'nodeversion': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f84253afe30>, 'outputs': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f84253af5f0>, 'public': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f84253afd70>, 'type': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f84253af830>, 'user': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f84253af3b0>, 'user_id': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f84253afcb0>, 'uuid': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f84253af770>}¶
-
attributes
¶
-
computer_name
= <sqlalchemy.sql.elements.Label object>¶
-
ctime
¶
-
dbcomputer
¶
-
dbcomputer_id
¶
-
description
¶
-
extras
¶
-
get_aiida_class
()[source]¶ Return the corresponding instance of
Node()
or a subclass return by the plugin loader.Todo
The behavior is quite pathetic, creating a django DbNode instance to instantiate the aiida instance. These means that every time you load Aiida instances with the QueryBuilder when using Django as a backend, three instances are instantiated for every Aiida instance you load! Could be fixed by allowing DbNode from the dummy nodel to be passed to AiidaNode’s __init__.
Returns: An instance of the plugin class
-
id
¶
-
label
¶
-
mtime
¶
-
nodeversion
¶
-
outputs
¶
-
public
¶
-
state
= <sqlalchemy.sql.elements.Label object>¶
-
type
¶
-
user
¶
-
user_email
= <sqlalchemy.sql.elements.Label object>¶
-
user_id
¶
-
uuid
¶
-
-
class
aiida.backends.djsite.querybuilder_django.dummy_model.
DbUser
(**kwargs)[source]¶ Bases:
sqlalchemy.ext.declarative.api.Base
-
__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 0x7f84253fe510; DbUser>¶
-
__module__
= 'aiida.backends.djsite.querybuilder_django.dummy_model'¶
-
__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('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 <lambda>>)), Column('date_joined', DateTime(timezone=True), table=<db_dbuser>, default=ColumnDefault(<function <lambda>>)), schema=None)¶
-
__tablename__
= 'db_dbuser'¶
-
_sa_class_manager
= {'date_joined': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f84253a3710>, 'email': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f84253a3110>, 'first_name': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f84253a3290>, 'id': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f8425342f50>, 'institution': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f84253a3410>, 'is_active': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f84253a3590>, 'is_staff': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f84253a34d0>, 'last_login': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f84253a3650>, 'last_name': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f84253a3350>, 'password': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f84253a31d0>}¶
-
date_joined
¶
-
email
¶
-
first_name
¶
-
id
¶
-
institution
¶
-
is_active
¶
-
is_staff
¶
-
last_login
¶
-
last_name
¶
-
password
¶
-
-
aiida.backends.djsite.querybuilder_django.dummy_model.
get_aldjemy_session
()[source]¶ Use aldjemy to make a session
-
class
aiida.backends.djsite.querybuilder_django.querybuilder_django.
QueryBuilderImplDjango
(*args, **kwargs)[source]¶ Bases:
aiida.backends.general.querybuilder_interface.QueryBuilderInterface
-
AiidaComputer
¶
-
AiidaGroup
¶
-
AiidaNode
¶
-
AiidaUser
¶
-
Computer
¶
-
Group
¶
-
Link
¶
-
Node
¶
-
User
¶
-
__abstractmethods__
= frozenset([])¶
-
__module__
= 'aiida.backends.djsite.querybuilder_django.querybuilder_django'¶
-
_abc_cache
= <_weakrefset.WeakSet object>¶
-
_abc_negative_cache
= <_weakrefset.WeakSet object>¶
-
_abc_negative_cache_version
= 39¶
-
_abc_registry
= <_weakrefset.WeakSet object>¶
-
first
(query)[source]¶ Executes query in the backend asking for one instance.
Returns: One row of aiida results
-
get_aiida_res
(key, res)[source]¶ Some instance returned by ORM (django or SA) need to be converted to Aiida instances (eg nodes)
Parameters: - res – the result returned by the query
- key – the key that this entry would be return with
Returns: an aiida-compatible instance
-
get_filter_expr
(operator, value, attr_key, is_attribute, alias=None, column=None, column_name=None)[source]¶ Applies a filter on the alias given. Expects the alias of the ORM-class on which to filter, and filter_spec. Filter_spec contains the specification on the filter. Expects:
Parameters: - operator – The operator to apply, see below for further details
- value – The value for the right side of the expression, the value you want to compare with.
- path – The path leading to the value
- attr_key – Boolean, whether the value is in a json-column, or in an attribute like table.
Implemented and valid operators:
for any type: * == (compare single value, eg: ‘==’:5.0) * in (compare whether in list, eg: ‘in’:[5, 6, 34]
- for floats and integers:
- >
- <
- <=
- >=
- for strings:
- like (case - sensitive), for example ‘like’:’node.calc.%’ will match node.calc.relax and node.calc.RELAX and node.calc. but not node.CALC.relax
- ilike (case - unsensitive) will also match node.CaLc.relax in the above example
Note
The character % is a reserved special character in SQL, and acts as a wildcard. If you specifically want to capture a
%
in the string, use:_%
for arrays and dictionaries (only for the SQLAlchemy implementation):
- contains: pass a list with all the items that the array should contain, or that should be among the keys, eg: ‘contains’: [‘N’, ‘H’])
- has_key: pass an element that the list has to contain or that has to be a key, eg: ‘has_key’:’N’)
- for arrays only (SQLAlchemy version):
- of_length
- longer
- shorter
All the above filters invoke a negation of the expression if preceded by ~:
# first example: filter_spec = { 'name' : { '~in':[ 'halle', 'lujah' ] } # Name not 'halle' or 'lujah' } # second example: filter_spec = { 'id' : { '~==': 2 } } # id is not 2
-
get_filter_expr_from_attributes
(operator, value, attr_key, column=None, column_name=None, alias=None)[source]¶ A classmethod that returns an valid SQLAlchemy expression.
Parameters: - operator – The operator provided by the user (‘==’, ‘>’, …)
- value – The value to compare with, e.g. (5.0, ‘foo’, [‘a’,’b’])
- attr_key (str) – The path to that attribute as a tuple of values. I.e. if that attribute I want to filter by is the 2nd element in a list stored under the key ‘mylist’, this is (‘mylist’, ‘2’).
- column – Optional, an instance of sqlalchemy.orm.attributes.InstrumentedAttribute or
- column_name (str) – The name of the column, and the backend should get the InstrumentedAttribute.
- alias – The aliased class.
Returns: An instance of sqlalchemy.sql.elements.BinaryExpression
-
iterall
(query, batch_size, tag_to_index_dict)[source]¶ Returns: An iterator over all the results of a list of lists.
-
iterdict
(query, batch_size, tag_to_projected_entity_dict)[source]¶ Returns: An iterator over all the results of a list of dictionaries.
-
modify_expansions
(alias, expansions)[source]¶ For the Django schema, we have as additioanl expansions ‘attributes’ and ‘extras’
-
table_groups_nodes
¶
-