Skip to content

neilalbrock/schematics-wtf

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

schematics-wtf

Convert Schematics Models to WTForms

In action ...

from schematics.models import Model
from schematics.types.base import StringType, IntType
from schematics_wtf.converter import model_form

class Test(Model):
    pk = StringType(required=True)
    name = StringType()
    age = IntType()
    country = StringType(default='US', choices=['US','UK'])

test = Test(dict(name="Dude",age=35,pk="saweet")))
TestForm = model_form(test, hidden=['pk'])
form = TestForm()

print form.name.label
print form.name()

returns

<label for="name">name</label>
<input id="name" name="name" type="text" value="Dude">

About

Schematics to WTForm converter

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%