Esempio n. 1
0
 def recentchanges(self, query):
     """Returns the list of changes matching the given query.
     
     Sample Queries:
         {"limit": 10, "offset": 100}
         {"limit": 10, "offset": 100, "key": "/authors/OL1A"}
         {"limit": 10, "offset": 100, "author": "/people/foo"}
     """
     engine = RecentChanges(self.db)
     
     limit = query.pop("limit", 1000)
     offset = query.pop("offset", 0)
     
     keys = "key", "author", "ip", "kind", "bot", "begin_date", "end_date", "data"
     kwargs = dict((k, query[k]) for k in keys if k in query)
     
     return engine.recentchanges(limit=limit, offset=offset, **kwargs)
Esempio n. 2
0
 def get_change(self, id):
     """Return the info about the requrested change.
     """
     engine = RecentChanges(self.db)
     return engine.get_change(id)