Pylons / pyramid_blogr

Pyramid_blogr is an example implementation of Flaskr app with Pyramid Web Framework
72 stars 39 forks source link

forms.py not in views directory? #54

Closed pauleveritt closed 8 years ago

pauleveritt commented 8 years ago

Just a minor nit...curious why it is up there, instead of a helper in views? It is only consumed by code in views.

ergo commented 8 years ago

How would you suggest moving the code, I like to keep the forms code separate from views themselves - but I'm open for suggestions.

pauleveritt commented 8 years ago

Do you anticipate using the forms code from any consumer outside of the views directory? If so, leave it. If not, just as a suggestion, have views/form_helpers.py or just views/forms.py

blaflamme commented 8 years ago

I usually prefer a domain approach and also separate schemas and forms, but not in the case of wtforms. So I end up with something like:

ergo commented 8 years ago

@pauleveritt I think i had some case of using form parsing outside of views - it was used in celery tasks to verify some data after parsing.

pauleveritt commented 8 years ago

Ok, let's close this then.