Exemplo n.º 1
0
 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(".")
Exemplo n.º 2
0
 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(".")
Exemplo n.º 3
0
 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(".")
Exemplo n.º 4
0
 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(".")