Ejemplo n.º 1
0
    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])
Ejemplo n.º 2
0
    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)
Ejemplo n.º 3
0
 def get_common_micropost(commonId):
     '''
     Get micropost by common to download key.
     '''
     return DocumentManager.get_document(
          MicroPost, "news/common", key=commonId)
Ejemplo n.º 4
0
 def get_picture_micropost(pictureId):
     '''
     Get picture by picture to download key.
     '''
     return DocumentManager.get_document(
          MicroPost, "news/picture", key=pictureId)
Ejemplo n.º 5
0
    def get_micropost(mid):
        '''
        Returns post of which id match given *id*.
        '''

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