예제 #1
0
 def getAllItems(self, request):
     """get All Items saved"""
     q = FeedItems.query()
     results = q.order(-FeedItems.updated).fetch(10)
     return FeedItemsForms(
         items=[self._copyFeedItemsToForm(item) for item in results]
     )
예제 #2
0
 def getItems(self, request):
     """Return Feed Items by websafeFeedKey."""
     feed = ndb.Key(urlsafe=request.websafeFeedKey).get()
     items = FeedItems.query(ancestor=feed.key)
     feed_info = feed.key.get()
     FeedTitle = getattr(feed_info, 'title')
     return FeedItemsForms(
         items=[self._copyFeedItemsToForm(item, FeedTitle) for item in items]
     )