radloggerpy.database.objects.serial_device module
- class radloggerpy.database.objects.serial_device.SerialDeviceObject(**kwargs)[source]
Bases:
DeviceObject
TODO(Dantali0n): Write something nice about SerialDeviceObject
- _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.Session
reference – 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.Session
references – add all these objects to the database
- baudrate = None
- bytesize = None
- static delete(session, reference, allow_multiple=False)[source]
Remove the object(s) that match the reference
- Parameters:
session – an active
sqlalchemy.orm.session.Session
reference – 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
- static find(session, reference, allow_multiple=True)[source]
Return object(s) that match the reference
- Parameters:
session – an active
sqlalchemy.orm.session.Session
reference – 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.Session
references – find database results based on these objects
- Returns:
list of objects or none, all objects will be instances of the class.
- m_serial_device = None
- parity = None
- port = None
- stopbits = None
- timeout = 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.Session
reference – 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