コード例 #1
0
ファイル: models.py プロジェクト: rakoo/newebe
    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 プロジェクト: rakoo/newebe
    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 プロジェクト: rakoo/newebe
    def get_micropost(mid):
        '''
        Returns post of which id match given *id*.
        '''

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