{"rsdb":{"rid":"241561","subhead":"","postdate":"0","aid":"166332","fid":"77","uid":"1","topic":"1","content":"
\n

\u95ee\u9898\u6765\u6e90\uff1a<\/span><\/strong><\/span><\/p> \n

\u5728\u5b66\u4e60Flask\u7f51\u4e0a\u6559\u7a0b\uff08PS\uff1a\u4e2d\u6587\u7248\u6559\u7a0b\u94fe\u63a5<\/a>\uff0c\u82f1\u6587\u7248\u6559\u7a0b\u5176\u4e2d\u4ee3\u7801\u662f\u5bf9\u7684\uff0c\u8fd0\u884c\u6ca1\u9519\u8bef\uff0c\u6211\u4e3a\u4e86\u770b\u7684\u5feb\u4e00\u4e9b\uff0c\u6240\u4ee5\u5c31\u76f4\u63a5\u770b\u7684\u4e2d\u6587\u7248>~<\uff0c\u82f1\u6587\u7248\u6559\u7a0b\u94fe\u63a5<\/a>\uff09\u65f6\uff0c\u4f7f\u7528\u5982\u4e0b\u4ee3\u7801\uff1a<\/span><\/p> \n

\n
from flask.ext.wtf import Form <\/strong><\/span>from<\/span> wtforms import<\/span> StringField, BooleanField\n<\/span>from<\/span> wtforms.validators import<\/span> DataRequired\n\n<\/span>class<\/span> LoginForm(Form):\n    openid <\/span>= StringField('<\/span>openid<\/span>'<\/span>, validators=[DataRequired()])\n    remember_me <\/span>= BooleanField('<\/span>remember_me<\/span>'<\/span>, default=False)<\/pre> \n <\/div> \n 

 \u7ed3\u679c\u4e0a\u8ff0\u6807\u8bb0\u7ea2\u8272\u90e8\u5206\u62a5\u9519\uff0c\u5373\u65e0\u6cd5\u5f15\u7528Form\u7c7b\u3002<\/span><\/p> \n

\n
from flask_wtf import Form <\/strong><\/span>from<\/span> wtforms import<\/span> TextField\n<\/span>from<\/span> wtforms.validators import<\/span> DataRequired\n\n<\/span>class<\/span> MyForm(Form):\n    name <\/span>= TextField('<\/span>name<\/span>'<\/span>, validators=[DataRequired()])<\/pre> \n <\/div> \n 

 <\/p> \n

\n
\u6ce8\u89e3\n\u4ece <\/span>0.9.0 \u7248\u672c\u5f00\u59cb\uff0cFlask-WTF \u4e0d\u518d\u4ece WTforms \u4e2d\u5bfc\u5165\u4efb\u4f55\u4e1c\u897f\uff0c\u4f60\u9700\u8981\u4ece WTForms \u5bfc\u5165\u5b57\u6bb5\u3002<\/pre> \n <\/div> \n 

 <\/span><\/p> \n

\u89e3\u51b3\u529e\u6cd5\uff1a\u5373\u628afrom flask.ext.wtf import Form\u6539\u6362\u6210<\/span><\/span><\/span><\/span>from flask_wtf import Form<\/span><\/span><\/span><\/span><\/span><\/strong><\/p> \n

\u5177\u4f53\u539f\u56e0\uff1a\u6211\u89c9\u5f97\u5e94\u8be5\u662fFlask-wtf\u7248\u672c\u539f\u56e0\u5bfc\u81f4\u3002<\/span><\/span><\/span><\/span><\/span><\/p>\n<\/div>","orderid":"0","title":"from flask.ext.wtf import Form\u5bfc\u5165\u62a5\u9519","smalltitle":"","mid":"0","fname":"Python","special_id":"0","bak_id":"0","info":"0","hits":"213","pages":"1","comments":"0","posttime":"2017-11-23 08:31:44","list":"1511397104","username":"admin","author":"","copyfrom":"","copyfromurl":"","titlecolor":"","fonttype":"0","titleicon":"0","picurl":"https:\/\/www.cppentry.com\/upload_files\/","ispic":"0","yz":"1","yzer":"","yztime":"0","levels":"0","levelstime":"0","keywords":"from<\/A> flask.ext.wtf<\/A> import<\/A> Form<\/A> \u5bfc\u5165<\/A>","jumpurl":"","iframeurl":"","style":"","template":"a:3:{s:4:\"head\";s:0:\"\";s:4:\"foot\";s:0:\"\";s:8:\"bencandy\";s:0:\"\";}","target":"0","ip":"14.20.31.236","lastfid":"0","money":"0","buyuser":"","passwd":"","allowdown":"","allowview":"","editer":"","edittime":"0","begintime":"0","endtime":"0","description":"from flask.ext.wtf import Form\u5bfc\u5165\u62a5\u9519","lastview":"1711481223","digg_num":"0","digg_time":"0","forbidcomment":"0","ifvote":"0","heart":"","htmlname":"","city_id":"0"},"page":"1"}

\u4e8e\u662f\u67e5\u770b\u53c2\u7167\u4e86\u4e00\u4e0bflask-WTF \u7684\u8be6\u5c3d\u4ecb\u7ecd\u7684\u5feb\u901f\u5165\u95e8<\/a>\u793a\u4f8b,\u5176\u4e2d\u4f7f\u7528Flask-WTF\u4ee3\u7801\u5982\u4e0b\uff1a<\/span><\/p> \n