Exemplo n.º 1
0
  def do_events(self, app_name, user_info, events=[]):
    uid = self.authentication(user_info)

    for event in events:
      collection_name = event.get('event_name', '')
      cls_info = RegisteredEvents.get_by_name(app_name, collection_name)
      self.do_event(cls_info=cls_info, uid=uid, event=event)
Exemplo n.º 2
0
  def do_query(self, app_name, query, fields, **kwargs):
    collection_name = query.pop('collection_name', '')
    from_datetime = query.pop('from_datetime', '')
    to_datetime = query.pop('to_datetime', '')

    cls_info = RegisteredEvents.get_by_name(app_name, collection_name)

    alias = cls_info['alias']
    key_fields = QueryInterpreter.parse(fields, alias)

    info = EventHandler.mget(from_datetime=from_datetime,
                             to_datetime=to_datetime, fields=key_fields)
    return info