Ejemplo n.º 1
0
 def for_name(cls, name, create=False):
     try:
         return Session.query(cls).filter_by(name=name).one()
     except NoResultFound:
         if create:
             return returnit(Session.add, cls(name))
         else:
             raise EventNotFound(name)
Ejemplo n.º 2
0
 def track(self, *args, **kwargs):
     return returnit(self._entries.append, Entry(*args, **kwargs))