当前位置: 首页>>代码示例>>Python>>正文


Python Users.get_user_image方法代码示例

本文整理汇总了Python中users.Users.get_user_image方法的典型用法代码示例。如果您正苦于以下问题:Python Users.get_user_image方法的具体用法?Python Users.get_user_image怎么用?Python Users.get_user_image使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在users.Users的用法示例。


在下文中一共展示了Users.get_user_image方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: get_publish_info4discovery

# 需要导入模块: from users import Users [as 别名]
# 或者: from users.Users import get_user_image [as 别名]
    def get_publish_info4discovery(publish, *params):
        result = {}
        longitude = params[0]
        latitude = params[1]
        user_id = params[2]
        try:
            if user_id == 0:
                result["attribute"] = -1
            else:
                result["attribute"] = UserPublishRelationMethods.get_attribute_by_user_and_publish(user_id, publish.id)

            result["publish_id"] = publish.id
            result["created_at"] = Datetimes.utc2east8(publish.created_at)
            result["win"] = UserPublishRelationMethods.get_win_attribute_count_by_publish(publish)
            result["lost"] = UserPublishRelationMethods.get_lost_attribute_count_by_publish(publish)

            if publish.user and publish.user.userextension:
                result["user_nickname"] = publish.user.userextension.nickname
            else:
                result["user_nickname"] = ""

            temp_image = Users.get_user_image(publish.user)
            result["user_small_image"] = temp_image["small_user_image"]

            temp_publish_images = Publishes.get_publish_images(publish)
            result["publish_image_url"] = temp_publish_images["publish_image_url"]
            result["publish_image_big_url"] = temp_publish_images["publish_image_big_url"]
            result["publish_image_medium_url"] = temp_publish_images["publish_image_medium_url"]
            result["publish_image_small_url"] = temp_publish_images["publish_image_small_url"]
            result["PM2_5"] = publish.PM2_5

            result["comment"] = Comments.get_by_publish(publish.id)
            result["content"] = publish.content

            result["bonus"] = RedEnvelopes.get_red_envelope_by_publish(publish.id)

            s = publish.shop
            big_category = ShopCategories.get_shop_big_category(publish.shop.category)

            if not big_category:
                big_category = ShopCategories.get_category_default()
            big_category_key = big_category.id
            result["big_category_name"] = big_category.name
            result["big_category_key"] = big_category.id

            if not big_category_key:
                result["category_operation"] = {}
            else:
                result["category_operation"] = PublishCategories.get_category_info_by_shop_category(big_category)
        except Exception as ex:
            Logs.print_current_function_name_and_line_number(ex)

        return result
开发者ID:appleface2050,项目名称:WorkCode_Bakup,代码行数:55,代码来源:discovery.py

示例2: get_publish_info4hot

# 需要导入模块: from users import Users [as 别名]
# 或者: from users.Users import get_user_image [as 别名]
    def get_publish_info4hot(publish, longitude, latitude, user_id):
        result = dict()

        result["created_at"] = Datetimes.transfer_datetime(publish.created_at)
        if publish.user:
            if publish.user.userextension:
                result["user_nickname"] = publish.user.userextension.nickname
            else:
                result["user_nickname"] = ""
        else:
            result["user_nickname"] = ""

        temp_image = Users.get_user_image(publish.user)
        result["user_small_image"] = temp_image["small_user_image"]
        result["PM2_5"] = publish.PM2_5

        result["content"] = publish.content

        category = publish.shop.category
        big_category = ShopCategories.get_shop_big_category(category)

        if not big_category:
            big_category = ShopCategories.get_category_default()

        if big_category:
            result["big_category_name"] = big_category.name
            result["big_category_key"] = big_category.id
        else:
            result["big_category_name"] = ""
            result["big_category_key"] = ""

        if not big_category:
            result["category_operation"] = {}
        else:
            result["category_operation"] = PublishCategories.get_category_info_by_shop_category(big_category)

        return result
开发者ID:appleface2050,项目名称:WorkCode_Bakup,代码行数:39,代码来源:publishes.py


注:本文中的users.Users.get_user_image方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。