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
Pull missing django forms definitions into floppyform namespace #1
Comments
Hi Paul, I agree, it looks like a very sane (and desired) behaviour. The missing fields should indeed be imported if they're not implemented. The docs probably need to be updated to say that the fields which are not implemented are aliased. I can do it at a later time, however if you want to fork and make the changes, feel free to do so :). I'd rather not have star imports, missing fields and widgets should ideally be imported explicitly. There's also django.forms.extras, which should probably be aliased, too. |
Thanks Paul for doing the work :) |
Fixed jazzband#184 Django 1.11 LTS
merging base repository
Let me first say that I really love the approach you're taking with this. I'm trying it out and I think it has a lot of potential.
In your instructions, you imply that installation is as simple as replacing the import and then creating new fields using the object included. While this is true, some of the fields available in
django.forms
are missing in thefloppyforms.forms
module. TheModelChoiceField
is one example of that. If you are converting a project that is already using that field and simply switch the import you will get'module' object has no attribute 'ModelChoiceField'
.If you imported each of the fields in
django.forms
into your namespace, it would be a drop-in replacement. They are all listed in the django forms reference. Later, if you decide to implement it in floppyforms, you can simply remove the import and add a class definition and people will get the updated version without having to change their code. They still have a way to opt-out and pick-and-choose.What do you think of this approach? I'm not sure if this goes against any sort of python best practice or not. You're already dependent on the django.forms module.
The text was updated successfully, but these errors were encountered: