當前位置: 首頁>>代碼示例>>Python>>正文


Python PictureManager.get_owner_last_pictures方法代碼示例

本文整理匯總了Python中newebe.apps.pictures.models.PictureManager.get_owner_last_pictures方法的典型用法代碼示例。如果您正苦於以下問題:Python PictureManager.get_owner_last_pictures方法的具體用法?Python PictureManager.get_owner_last_pictures怎麽用?Python PictureManager.get_owner_last_pictures使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在newebe.apps.pictures.models.PictureManager的用法示例。


在下文中一共展示了PictureManager.get_owner_last_pictures方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: send_pictures_to_contact

# 需要導入模塊: from newebe.apps.pictures.models import PictureManager [as 別名]
# 或者: from newebe.apps.pictures.models.PictureManager import get_owner_last_pictures [as 別名]
    def send_pictures_to_contact(self, client, contact, now, date):
        '''
        Send pictures from last month to given contact.
        '''
        pictures = PictureManager.get_owner_last_pictures(
                startKey=date_util.get_db_date_from_date(now),
                endKey=date_util.get_db_date_from_date(date))

        for picture in pictures:
            if tags_match(picture, contact):
                client.post_files(
                    contact,
                    PICTURE_PATH,
                    {"json": str(picture.toJson(localized=False))},
                    [("picture",
                      str(picture.path),
                      picture.fetch_attachment("th_" + picture.path))
                    ],
                    self.onContactResponse)
開發者ID:DopeChicCity,項目名稱:newebe,代碼行數:21,代碼來源:handlers.py

示例2: post

# 需要導入模塊: from newebe.apps.pictures.models import PictureManager [as 別名]
# 或者: from newebe.apps.pictures.models.PictureManager import get_owner_last_pictures [as 別名]
    def post(self):
        '''
        When a post request is sent, the newebe downloads full size version of
        picture specified in the request from the contact also specified in
        the request.
        '''
        data = self.get_body_as_dict()

        contact = ContactManager.getTrustedContact(data["contact"]["key"])

        if contact:
            date = data["picture"]["date"]

            picture = PictureManager.get_owner_last_pictures(date).first()

            if picture:
                self.on_picture_found(picture, id)
            else:
                logger.info("Picture no more available.")
                self.return_failure("Picture not found.", 404)
        else:
            logger.info("Contact unknown")
            self.return_failure("Picture not found", 404)
開發者ID:mpmedia,項目名稱:newebe,代碼行數:25,代碼來源:handlers.py

示例3: when_i_get_my_last_pictures

# 需要導入模塊: from newebe.apps.pictures.models import PictureManager [as 別名]
# 或者: from newebe.apps.pictures.models.PictureManager import get_owner_last_pictures [as 別名]
def when_i_get_my_last_pictures(step):
    world.pictures = PictureManager.get_owner_last_pictures().all()
開發者ID:DopeChicCity,項目名稱:newebe,代碼行數:4,代碼來源:steps.py

示例4: when_i_get_owner_pictures_until_november_1

# 需要導入模塊: from newebe.apps.pictures.models import PictureManager [as 別名]
# 或者: from newebe.apps.pictures.models.PictureManager import get_owner_last_pictures [as 別名]
def when_i_get_owner_pictures_until_november_1(step):
    world.pictures = PictureManager.get_owner_last_pictures(
            "2011-11-01T23:59:00Z").all()
開發者ID:DopeChicCity,項目名稱:newebe,代碼行數:5,代碼來源:steps.py


注:本文中的newebe.apps.pictures.models.PictureManager.get_owner_last_pictures方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。