예제 #1
0
    def get(self):
        home_url = self.app.config['home_url']
        if home_url:
            webapp2.redirect(home_url, abort=True)
            return

        values = {'coupon_types': model.list_coupon_types()}
        write_template(self.response, 'index.html', values)
예제 #2
0
def get_coupon_type_map():
    return {ct.id: ct.title for ct in model.list_coupon_types()}
예제 #3
0
 def __init__(self, *args, **kwargs):
     super(CouponSpawnForm, self).__init__(*args, **kwargs)
     ctypes = [(t.id, t.title) for t in model.list_coupon_types()]
     ctypes.insert(0, ('', ''))  # empty choice at the front
     self.coupon_type.choices = ctypes