def get(self): events = Event.objects(next_update__lte=datetime.datetime.now()).all() res = [] for event in events: res.append(event.to_dict()) js = json.dumps(res) resp = Response(js, status=200, mimetype='application/json') return resp
def run(self, name, slug, etype, freq, group, tags): puts("Adding Event:") with indent(4): puts("Name: %s" % (name)) puts("Slug: %s" % (slug)) puts("Event Type: %s" % (etype)) puts("Frequency: %s" % (freq)) puts("Group: %s" % (group)) puts("Tags: %s" % (tags)) event = Event() event.name = name event.slug = slug event.event_type = etype event.frequency = freq event.group = group event.tags = tags event.save()