You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
656 B
24 lines
656 B
from minibase.blueprints.sensor.models import nbiotDevice, nbiotDeviceStatus, nbiotDeviceType, nbiotDeviceArea
|
|
import minibase.blueprints.database.utils as dbUtils
|
|
from sqlalchemy import case
|
|
|
|
|
|
|
|
def queryById(id):
|
|
return nbiotDevice.query.filter_by(id=id).first()
|
|
|
|
|
|
def queryStatusNamesWithDefault(defId):
|
|
choices = dbUtils.queryNameWithDefaultId(nbiotDeviceStatus, defId)
|
|
return choices
|
|
|
|
|
|
def queryTypeNamesWithDefault(defId):
|
|
choices = dbUtils.queryNameWithDefaultId(nbiotDeviceType, defId)
|
|
return choices
|
|
|
|
|
|
def queryAreaNamesWithDefault(defId):
|
|
choices = dbUtils.queryNameWithDefaultId(nbiotDeviceArea, defId)
|
|
return choices
|