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.
50 lines
1.2 KiB
50 lines
1.2 KiB
from minibase.blueprints.company.models import Companies, Company_legal_entities, Company_types, Company_status, Company_relations
|
|
|
|
|
|
def queryByNameFirst(cname):
|
|
return Companies.query.filter_by(name=cname).first()
|
|
|
|
|
|
def queryById(cid):
|
|
return Companies.query.filter_by(id=cid).first()
|
|
|
|
|
|
def queryNameById(cid):
|
|
selected = Companies.query.filter_by(id=cid).first()
|
|
return selected.name
|
|
|
|
|
|
def queryStreetById(cid):
|
|
selected = Companies.query.filter_by(id=cid).first()
|
|
return selected.street
|
|
|
|
|
|
def queryStreetNoById(cid):
|
|
selected = Companies.query.filter_by(id=cid).first()
|
|
return selected.street_no
|
|
|
|
|
|
def queryImageById(cid):
|
|
selected = Companies.query.filter_by(id=cid).first()
|
|
return selected.image_file
|
|
|
|
|
|
def queryLegalEntityNames():
|
|
choices = Company_legal_entities.query.order_by(Company_legal_entities.name.asc())
|
|
return choices
|
|
|
|
|
|
def queryTypeNames():
|
|
choices = Company_types.query.order_by(Company_types.name.asc())
|
|
return choices
|
|
|
|
|
|
def queryRelationNames():
|
|
choices = Company_relations.query.order_by(Company_relations.name.asc())
|
|
return choices
|
|
|
|
|
|
def queryStatusNames():
|
|
choices = Company_status.query.order_by(Company_status.name.asc())
|
|
return choices
|