コード例 #1
0
ファイル: models.py プロジェクト: HeartbliT/IReVeAI
    def get_contact_micropost(contactKey, date):
        '''
        Returns all micropost posted by a given contact. Contact key is used
        to retrieve the microposts.
        '''

        return DocumentManager.get_document(
                             MicroPost, "news/contact", key=[contactKey, date])
コード例 #2
0
ファイル: models.py プロジェクト: HeartbliT/IReVeAI
    def get_first(dateKey):
        '''
        Return first micro post written by current user from the list of micro
        posts corresponding to given date. Normally there should be only
        one post for this date, so the list should have only one element.

        Date format is set in news_settings.DB_DATE_FORMAT.

        Arguments:
          *date* Date used to retrieve micro post.
        '''

        return DocumentManager.get_document(MicroPost, "news/all", dateKey)
コード例 #3
0
ファイル: models.py プロジェクト: HeartbliT/IReVeAI
 def get_common_micropost(commonId):
     '''
     Get micropost by common to download key.
     '''
     return DocumentManager.get_document(
          MicroPost, "news/common", key=commonId)
コード例 #4
0
ファイル: models.py プロジェクト: HeartbliT/IReVeAI
 def get_picture_micropost(pictureId):
     '''
     Get picture by picture to download key.
     '''
     return DocumentManager.get_document(
          MicroPost, "news/picture", key=pictureId)
コード例 #5
0
ファイル: models.py プロジェクト: HeartbliT/IReVeAI
    def get_micropost(mid):
        '''
        Returns post of which id match given *id*.
        '''

        return DocumentManager.get_document(MicroPost, "news/full", mid)