Пример #1
0
def create_channel(id):
    # create new entry in database for channel with this id, if it doesn't exist
    q = Channels.all()
    logging.info("id = '%s'"%id)
    c = q.filter("id =", id).get()
    if c is None:
        c = Channels(id = id, msg = [])
    else:
        # already have such a channel  # TODO -- how should we really check that this is not empty!?
        logging.info("found one")
        c.msg = []
    c.put()
    return '0'
Пример #2
0
def drop():
    from fake_channel import Channels
    for a in Channels.all():
        a.delete()
    return redirect('db/fake_channels')