Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated to Flask-WTF 0.9.3 #47

Closed
wants to merge 8 commits into from
Closed

Updated to Flask-WTF 0.9.3 #47

wants to merge 8 commits into from

Conversation

mdxs
Copy link
Member

@mdxs mdxs commented Dec 9, 2013

Updated to Flask-WTF 0.9.3; note that this requires us to import wtforms and wtforms.validators ourselves: see https://flask-wtf.readthedocs.org/en/latest/upgrade.html#version-0-9-0 reading: "Dropping the imports of wtforms is a big change, it may be lots of pain for you, but the imports are hard to maintain. Instead of importing Fields from Flask-WTF, you need to import them from the original wtforms" (and this applies to the validators as well).

@lipis
Copy link
Member

lipis commented Dec 9, 2013

I also wanted to do some upgrades here but I'm basically waiting for the WTForms to release the final version 2.0 in order to touch Flask-WTF, because I don't want to break backwards compatibilities too often.. Thanks but I think, this one will be revised when it's time.. for now it works nicely :)

@lipis
Copy link
Member

lipis commented Dec 9, 2013

Forgot the link that I wanted to post: http://wtforms.readthedocs.org/en/latest/whats_new.html

@topless
Copy link
Member

topless commented Dec 9, 2013

Great eye .. we missed couple of updates. Irrelevant but maybe we should put down all the backwards incompatible changes for version 2.

  1. modelq, dedicated model methods for the queries. It will clean up a lot the handlers and will improve modularity.
  2. Lazy loading. I think this one is a must. It will boost performance of the application, especially while it grows.
    http://flask.pocoo.org/docs/patterns/lazyloading/

@mdxs
Copy link
Member Author

mdxs commented Dec 10, 2013

The last commit is based on http://flask.pocoo.org/docs/extensiondev/#anatomy-of-an-extension showing that the flask.ext. notation can be followed to find the extensions (which in recent incarnations of Flask are all moving towards a more maintainable structure).

@mdxs
Copy link
Member Author

mdxs commented Dec 10, 2013

The same article referred to above shows that flask_wtf (as it is also named in the original source: https://github.com/lepture/flask-wtf/tree/master/flask_wtf) can sit in our main/lib/ while the flask.ext does it's magic to resolve imports from flask.ext.wtf (this seems to be a common pattern for Flask extensions).

@mdxs
Copy link
Member Author

mdxs commented Dec 10, 2013

After moving relevant changes and background information here, the gae-init-babel specific PR was closed in favour of this PR in the gae-init parent project. Though acceptance is likely to be postponed, I hope this PR helps document the steps taken and the rationale behind them. This PR may become obsolete if WTForms 2.0 releases... though I wonder whether that would make Flask-WTF itself obsolete.

@mdxs
Copy link
Member Author

mdxs commented Dec 10, 2013

The Flask-WTF project is tracking WTForms 2.0 also, see wtforms/flask-wtf#94

@lipis
Copy link
Member

lipis commented Dec 10, 2013

Now we just have to see who is going to deliver first... and if we could drop one of them would be also cool to have less dependencies.. Much appreciated the research that you're making... I'll buy you a beer when we'll be in the same city at one point :D

@mdxs
Copy link
Member Author

mdxs commented Dec 10, 2013

Thanks. I will probable need to read up on WTForms, but I thought Flask-WTF glued WTForms to Flask; and thus we would continue to use it (unless it would become obsolete/pointless when all features are in WTForms 2.0...)

@mdxs
Copy link
Member Author

mdxs commented Dec 20, 2013

Superseded by #59 "Update Flask-WTF to 0.9.4" which is a much cleaner PR because of steps already taken in gae-init recently.

@mdxs mdxs closed this Dec 20, 2013
@mdxs mdxs deleted the upd_flask_ext_wtf branch January 2, 2014 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants