def get_user_info(user_extension): result = dict() result = Objects.get_object_info(user_extension) temp = Objects.get_object_info(user_extension.user) temp["user_id"] = temp["id"] result["userextension_id"] = result["id"] result.update(temp) return result
def get_info(red_envelope): try: result = Objects.get_object_info(red_envelope) return result except Exception as ex: Logs.print_current_function_name_and_line_number(ex) return dict()
def get_big_categories(): category_list = list() categories = ShopCategory.objects.filter(parent_id=1) for c in categories: temp = Objects.get_object_info(c) category_list.append(temp) return category_list
def get_category_info(category): result = Objects.get_object_info(category) owners = list() for owner in category.owners.all(): user_extension = Users.get_user_extension(owner.username) if user_extension: owners.append(Users.get_user_info(user_extension)) result["owners"] = owners return result
def get_info(detector): result = Objects.get_object_info(detector) result_weather = None try: relation = DetectorRelation.objects.exclude(state=False).get(mac_address=detector.mac_address) result["shop_address"] = relation.address # Logs.print_log("shop_address", relation.address) # if relation.shop: # if relation.shop.dianping_business_id: # result["shop_address"] = relation.shop.dianping_city + relation.shop.dianping_address # else: # if relation.shop.address: # result["shop_address"] = relation.shop.address.detail_address # else: # result["shop_address"] = None # Logs.print_log("relation.city", relation.city) if relation.city: weather = Weathers.get_weather_from_db(relation.city) result["address"] = relation.address if not weather or Weathers.is_weather_in_db_timeout(weather): weather = Weathers.get_weather_from_heweather(relation.city) # Logs.print_log("weather", weather) Weathers.create_weather(weather) result_weather = weather else: result_weather = Weathers.get_weather_info(weather) except Exception as ex: Logs.print_current_function_name_and_line_number(ex) result_weather = None if result_weather: for (key, value) in result_weather.items(): result["weather_" + key] = value return result
def get_info(label): return Objects.get_object_info(label)
def get_info(comment): return Objects.get_object_info(comment)
def get_info(address): return Objects.get_object_info(address)
def get_info(publish): result = dict() result = Objects.get_object_info(publish) return result
def get_info(game): result = Objects.get_object_info(game) result["ranking"] = Games.get_ranking(game.score) return result
def get_one(detector): return Objects.get_object_info(detector)
def get_detector_relation_info(detector_relation): return Objects.get_object_info(detector_relation)
def get_info(article): return Objects.get_object_info(article)
def get_weather_info(weather): try: return Objects.get_object_info(weather) except Exception as ex: Logs.print_current_function_name_and_line_number(ex) return None
def get_shop_info(shop): result = Objects.get_object_info(shop) return result