Beispiel #1
0
def get_current_version():
    if 'db_version' in prop.get_all_props():
        db_version = int(prop.get_all_props()['db_version'])
    else:
        prop.PropModel(kkey='db_version', value='1').put()
        db_version = 1
    return db_version
Beispiel #2
0
def render_mail_template(which, booking_info):
    key_base = 'mail.' + which + '.' + si18n.get_lang_id()
    subject_template = unicode(prop.get_all_props()[key_base + '.subject'])
    body_template = unicode(prop.get_all_props()[key_base + '.body'])

    return (
        render(subject_template, booking_info),
        render(body_template, booking_info)
    )
Beispiel #3
0
def prop_get(key):
    ps = prop.get_all_props()
    if key in ps:
        return '{ "value" : ' + json.dumps(ps[key]) + ' }'
    return '{ "value" : "Unknown property: ' + key + '" }'