Wow, nice memory Tim !

Yes it's a problem I've been trying to find a solution for during the last
years. We've had a solution in DAL v2 by providing a custom model form
which would make relation fields to a model that has an autocomplete
registered use an autocomplete field by default. This solution was really
hard to maintain, and not even portable.

I couldn't reuse the system to just FlatPage use a wysiwyg field by
default, and had to go the usual, and I recon a bit messy road:
https://gist.github.com/Kub-AT/3676137 This is when I realized it had to be
part of the features that should be dropped from DAL v2 to v3, in favor of
a more generic and supported way.

The older discussion proposed another angle, in the spirit of #22609 [0],
that was not convincing because it would increase coupling between forms
and models because it requires to add even more form stuff in models,
because of the nature of the solution that was per-modelfield.

This is why this new proposal is based on a project-level callback setting
instead:

- does not require to add any additional form stuff to models.py,
- allows to override default form fields or form field options without
touching their code.

Note that there was also a suggestion to do something with fields_for_model
[1] to solve the problem, I don't think we're done studying this road on
the other thread so there might be more implementations to suggest here,
even though I feel like just being able to tweak defaults with a global
callback as proposed would just do the trick.

[0] https://code.djangoproject.com/ticket/22609
[1] https://github.com/django/django/blob/master/django/forms/models.py#L111

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CALC3Kad7%2BPrkJC0Cz2SsoB374%2BNxuJcN7z_2pANOQzpdBneBFg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to