Incase anyone was curious here are the default Widgets for WTForms in python
seen from South Africa
seen from United Kingdom

seen from Argentina

seen from United Kingdom
seen from United States
seen from Latvia
seen from United States
seen from Finland
seen from United Kingdom

seen from United States

seen from United States
seen from Italy
seen from Germany

seen from Poland
seen from Peru

seen from Greece
seen from China
seen from Poland

seen from Ukraine
seen from Argentina
Incase anyone was curious here are the default Widgets for WTForms in python
wtformsのFormFieldではまった
Flaskでのform生成にwtformsを使っている。 Djangoライク な感覚で使えるのだけどFieldList+FormFieldの使い方でどはまりした。
#!/usr/bin/env python26 # -*- mode: python -*- -*- coding: utf-8 -*- from wtforms import Form, IntegerField, TextField, FieldList, FormField class SampleEachForm(Form): id = IntegerField(u'id') name = TextField(u'name') class SampleForm(Form): names = FieldList(FormField(SampleEachForm)) if __name__ == "__main__": # だめなパターン(SampleEachFormを引数与えて初期化) s = SampleEachForm(id=1, name='foo') sample = SampleForm(names=[s]) print sample.names # いいパターン(SampleEachFormを引数なしで初期化) s = SampleEachForm() s.id=1 s.name='foo' sample = SampleForm(names=[s]) print sample.names
だめなパターンでやるとなにがダメかというとフォーム生成時にInputボックス内にエスケープされたhtmlコードがはいるのだ。本当に欲しいのはただの値のみなのに。
気付くのに1日くらいかかった。
홍민희 블로그가 이전됐습니다.
내용은 위치만 다음 URL로 이동했을 뿐, 여전히 보존되어 있습니다.
http://blog.hongminhee.org/2011/09/02/9669001671/