Created
November 5, 2014 18:14
-
-
Save felipeblassioli/c0bfa4484e9a377bdcca to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask | |
from wtforms import Form, Field, TextField, FieldList, SelectField | |
from wtforms.widgets import TextInput, html_params, ListWidget | |
class H4ckedFieldList(FieldList): | |
widget = ListWidget(prefix_label=False) | |
class SomeRandomForm(Form): | |
name = TextField('Name') | |
authors = H4ckedFieldList(TextField('Name'),TextField('Name2')) | |
authors2 = H4ckedFieldList(TextField('Name')) | |
def __init__(self, *args, **kwargs): | |
super(SomeRandomForm, self).__init__(*args,**kwargs) | |
self.authors2.append_entry() | |
self.authors2.append_entry() | |
# self.h4x0r_field.users = users | |
# self.neat_field.users = users | |
# ================== # | |
app = Flask(__name__, static_url_path='') | |
@app.route('/') | |
def index(): | |
form = SomeRandomForm() | |
print 'ha' | |
print form.authors() | |
print form.authors.entries | |
print form.authors2() | |
print form.authors2.entries | |
return 'hhh' | |
if __name__ == '__main__': | |
app.run(debug=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment