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

Pull missing django forms definitions into floppyform namespace #1

Closed
poswald opened this issue Jan 19, 2011 · 2 comments
Closed

Pull missing django forms definitions into floppyform namespace #1

poswald opened this issue Jan 19, 2011 · 2 comments

Comments

@poswald
Copy link
Contributor

poswald commented Jan 19, 2011

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 the floppyforms.forms module. The ModelChoiceField 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.

@brutasse
Copy link
Collaborator

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.

@brutasse
Copy link
Collaborator

Thanks Paul for doing the work :)

hsmett pushed a commit to hsmett/django-floppyforms that referenced this issue Sep 6, 2017
ewjoachim pushed a commit to peopledoc/django-floppyforms that referenced this issue Dec 13, 2021
This issue was closed.
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

No branches or pull requests

2 participants