radloggerpy.database.objects.measurement module
- class radloggerpy.database.objects.measurement.MeasurementObject(**kwargs)[source]
Bases:
DatabaseObjectMeasurement object with base model attributes
The device attribute can be set to an instance of
radloggerpy.database.objects.device.DeviceObjectwith any desired attribute set. When this is set it will be used by methods if applicable.- _abc_impl = <_abc._abc_data object>
- static add(session, reference)[source]
Add the reference object to the database
- Parameters:
session – an active
sqlalchemy.orm.session.Sessionreference – add database entries based on this object
- static add_all(session, references)[source]
Add all specified objects to the database
- Parameters:
session – an active
sqlalchemy.orm.session.Sessionreferences – add all these objects to the database
- cpm = None
- static delete(session, reference, allow_multiple=False)[source]
Remove the object(s) that match the reference
- Parameters:
session – an active
sqlalchemy.orm.session.Sessionreference – remove database entries based on this object
allow_multiple – if updating multiple database items is allowed
- Raises:
MultipleResultsFound – if multiple results were found with allow_multiple as False of type
sqlalchemy.exc.MultipleResultsFound
- device = None
- static find(session, reference, allow_multiple=True)[source]
Return object(s) that match the reference
- Parameters:
session – an active
sqlalchemy.orm.session.Sessionreference – find database results based on this object
allow_multiple – if updating multiple database items is allowed
- Raises:
MultipleResultsFound – if multiple results were found with allow_multiple as False of type
sqlalchemy.exc.MultipleResultsFound- Returns:
A single object, list of objects or none, all objects will be instances of the class.
- static find_all(session, references)[source]
For every specified object find all its matching database objects
- Parameters:
session – an active
sqlalchemy.orm.session.Sessionreferences – find database results based on these objects
- Returns:
list of objects or none, all objects will be instances of the class.
- id = None
- m_measurement = None
- svh = None
- timestamp = None
- static update(session, reference, base, allow_multiple=False)[source]
Find the reference(s) in the database and update with own state
- Parameters:
session – an active
sqlalchemy.orm.session.Sessionreference – the object with the desired changes
base – current state of the object in the database
allow_multiple – if updating multiple database items is allowed
- Raises:
MultipleResultsFound – if multiple results were found with allow_multiple as False of type
sqlalchemy.exc.MultipleResultsFound