def edit(self, **kw): values = [] if kw.get("id"): key = Key.by_id(kw["id"]) values = dict(id=key.id, key_name=key.key_name, numeric=key.numeric) return dict(form=self.form, action="./save", options={}, value=values)
def save(self, **kw): if kw['id']: key = Key.by_id(kw['id']) key.key_name = kw['key_name'] else: key = Key(key_name=kw['key_name']) session.add(key) if 'numeric' in kw: key.numeric = kw['numeric'] flash( _(u"OK") ) redirect(".")
def save(self, **kw): if kw["id"]: key = Key.by_id(kw["id"]) key.key_name = kw["key_name"] else: key = Key(key_name=kw["key_name"]) session.add(key) if "numeric" in kw: key.numeric = kw["numeric"] flash(_(u"OK")) redirect(".")
def save(self, **kw): if kw['id']: key = Key.by_id(kw['id']) key.key_name = kw['key_name'] else: if Key.query.filter_by(key_name=kw['key_name']).first(): flash(u"Key Type exists: %s" % kw['key_name']) redirect(".") key = Key(key_name=kw['key_name']) session.add(key) key.numeric = kw['numeric'] flash(_(u"OK")) redirect(".")
def save(self, **kw): if kw["id"]: key = Key.by_id(kw["id"]) key.key_name = kw["key_name"] else: if Key.query.filter_by(key_name=kw["key_name"]).first(): flash(u"Key Type exists: %s" % kw["key_name"]) redirect(".") key = Key(key_name=kw["key_name"]) session.add(key) key.numeric = kw["numeric"] flash(_(u"OK")) redirect(".")
def edit(self, **kw): values = [] if kw.get('id'): key = Key.by_id(kw['id']) values = dict(id=key.id, key_name=key.key_name, numeric=key.numeric) return dict( form=self.form, action='./save', options={}, value=values, )
def edit(self,**kw): values = [] if kw.get('id'): key = Key.by_id(kw['id']) values = dict( id = key.id, key_name = key.key_name, numeric = key.numeric ) return dict( form = self.form, action = './save', options = {}, value = values, )
def remove(self, **kw): remove = Key.by_id(kw['id']) session.delete(remove) flash( _(u"%s Deleted") % remove.key_name ) raise redirect(".")