def __init__(self, id, trashed, app, authors, title, time, location, description): super().__init__(id=id, trashed=trashed, app=app) Editable.__init__(self, authors=authors) self.title = title self.time = parse_isotime(time) if time else None self.location = location self.description = description self._items_key = self.id + '.items' self._trashed_items_key = self.id + '.trashed_items' self.items = JSONRedisMapping(self.app.r, self._items_key) self.trashed_items = JSONRedisMapping(self.app.r, self._trashed_items_key)
def setUp(self): super().setUp() self.objects = OrderedDict([('cat:0', Cat('cat:0', 'Happy')), ('cat:1', Cat('cat:1', 'Grumpy')), ('cat:2', Cat('cat:2', 'Long')), ('cat:3', Cat('cat:3', 'Monorail')), ('cat:4', Cat('cat:4', 'Ceiling'))]) self.r.omset(self.objects) self.r.rpush('cats', *self.objects.keys()) self.cats = JSONRedisMapping(self.r, 'cats')
def __init__(self, redis_url='', email='bot@localhost', smtp_url='', render_email_auth_message=None): super().__init__(redis_url=redis_url, email=email, smtp_url=smtp_url, render_email_auth_message=render_email_auth_message) self.types.update({'Meeting': Meeting, 'AgendaItem': AgendaItem}) self.meetings = JSONRedisMapping(self.r, 'meetings')