def get_one_main_page(__id=None): try: __body = {'_id': __id} __key = {'name': 1, 'image': 1, "special_offer_text": 1} __i = MongodbModel(body=__body, key=__key, collection="services").get_one_key() return dict( _id=__i['_id'], name=__i['name'], special_offer_text=__i['special_offer_text'], image=__i['image'] if "image" in __i.keys() else "", ) except: return False
def get_one_main_page(__id=None): try: __body = {'_id': __id} __key = {'name': 1, 'image': 1, "special_offer_text": 1} __i = MongodbModel(body=__body, key=__key, collection="services").get_one_key() return dict( _id=__i['_id'], name=__i['name'], special_offer_text=__i['special_offer_text'], image=__i['image'] if "image" in __i.keys() else "", ) except: return False
def get_one_main_page(__id=None): try: __body = {'_id': __id} __key = {'name': 1, 'image': 1, 'city': 1, 'industrial_town': 1, 'description': 1} __i = MongodbModel(body=__body, key=__key, collection="companies").get_one_key() return dict( _id=__i['_id'], name=__i['name'], image=__i['image'] if "image" in __i.keys() else "", city=ProvinceCityModel(_id=__i['city']).get_city()['name'], industrial_town=IndustrialTownCompaniesModel(_id=__i['industrial_town']).get_one()['name'], description=__i['description'] ) except: return False
def get_one_main_page(__id=None): try: __body = {'_id': __id} __key = { 'name': 1, 'image': 1, 'city': 1, 'industrial_town': 1, 'description': 1 } __i = MongodbModel(body=__body, key=__key, collection="companies").get_one_key() return dict( _id=__i['_id'], name=__i['name'], image=__i['image'] if "image" in __i.keys() else "", city=ProvinceCityModel(_id=__i['city']).get_city()['name'], industrial_town=IndustrialTownCompaniesModel( _id=__i['industrial_town']).get_one()['name'], description=__i['description']) except: return False