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

Feature/forms #10

Merged
merged 9 commits into from
Jun 6, 2024
Merged

Feature/forms #10

merged 9 commits into from
Jun 6, 2024

Conversation

josihoppe
Copy link
Collaborator

No description provided.

@josihoppe josihoppe requested a review from henhuy June 3, 2024 13:19
Copy link
Contributor

@henhuy henhuy left a 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.

Comment on lines 22 to 26
form_classes = [
f
for f in globals().values()
if isinstance(f, type) and issubclass(f, forms.Form)
]
Copy link
Contributor

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:
Copy link
Contributor

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.

@henhuy henhuy merged commit e8d011e into main Jun 6, 2024
1 of 2 checks passed
@henhuy
Copy link
Contributor

henhuy commented Jun 6, 2024

Merged it already - will do form validation stuff later. Thx for fixing forms reading.

@henhuy henhuy deleted the feature/forms branch June 6, 2024 11:15
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.

2 participants