You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Many of the database objects methods share a lot of code that could potentially be reduced.
deffind(session, reference, allow_multiple=True):
reference._build_object()
"""Only look for serial devices"""reference.m_device.interface=DeviceInterfaces.SERIALbase_filters=reference._filter(reference.m_device)
"""Check if reference is base or child type when setting filters"""ifhasattr(reference, 'm_serial_device'):
filters=reference._filter(reference.m_serial_device)
else:
filters= {}
query=session.query(Device).filter_by(**base_filters)\
.join(SerialDevice).filter_by(**filters)
Many of the database objects methods share a lot of code that could potentially be reduced.
The text was updated successfully, but these errors were encountered: