-
Notifications
You must be signed in to change notification settings - Fork 0
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
Feature/forms #10
Feature/forms #10
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the implementation.
Looks very good so far. I have two requests in order to return user feedback, when forms are invalid and a simplification.
form_classes = [ | ||
f | ||
for f in globals().values() | ||
if isinstance(f, type) and issubclass(f, forms.Form) | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like the implementation, but I think it would be cleaner (more explicit) to simply have a list of Forms which should be shown on this view. Also, once we have an additional form in forms.py, which is not used on this view, we run into problems...
all_valid = all(form.is_valid() for form in form_instances) | ||
|
||
context = {"form_instances": form_instances} | ||
if all_valid: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here, you could check if some are not valid first, and return view with forms back to user showing the errors in the form.
Merged it already - will do form validation stuff later. Thx for fixing forms reading. |
No description provided.