There is a history of problems related to the coupling between forms and
models. For example, when a user suggested to pass a field instance to the
model field to make it default [0], or when I suggested to improve
formfield [1]: it was rejected because it would increase the coupling
between forms and models:

On Saturday, April 2, 2016 at 10:44:44 AM UTC+2, Florian Apolloner wrote:
> On Thursday, March 17, 2016 at 2:17:40 PM UTC+1, Tim Graham wrote:
> > It seems useful, but I'm not sure if it increases the coupling between
model and forms in an undesirable way?
> Yeah, I am also mostly worried about this. formfield for me is a quick
shortcut, if you want to customize it, do it at the form level imo.

So this leaves the one problem we actually want to see resolved: mandatory
coupling between forms and models. Which looks like the root cause, which
makes it different from the other threads which propose solutions to
problems created because of that, at least that's what I thought.

Here is a solution Tim already proposed [2]:

    from django.db import models
    models.CharField.register_formfield(MyCustomFormField)

As for the DEP, well I was going to just write one and submit it but then I
realized I could follow the advice in 1. Pre-Proposal of DEP0001:

> The DEP Author (see below for the formal definition of an Author) should
> first attempt to ascertain whether the idea is DEP-able. Posting to
> django-developers is the best way to go about this.
> Vetting an idea publicly before going as far as writing a DEP is meant to
> save the potential author time.


But I don't mind not writing it, it'll be easier for everybody if a native
speaker and more experienced django contributor would take care of it, if
it were to be accepted.

[1] https://code.djangoproject.com/ticket/22609
[1] https://groups.google.com/forum/#!topic/django-developers/TblESVmxGfw
[2]
https://groups.google.com/forum/#!topic/django-developers/zG-JvS_opi4/discussion

-- 
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/CALC3KacJ_Rr1viUvz9dmc446nG-GZCQyzPoY2aAr6xRc25G0bw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to