>
> About 1, if it's already working with a non-signal, how could it not work
> with a signal ? It is, after all, called from within formfield() in this
> implementation, so anything that's working today when formfield() is
> called, should work when formfield() emits a signal.
>

Signal handlers need to be registered before they get called. ModelForms
can be imported and thus instantiate their form fields by calling the model
fields' formfield() methods before your custom handler gets registered, so
they wouldn't be changed.

Btw another point for customization of forms would be the post_init form
signal as suggested here:
https://groups.google.com/forum/#!topic/django-developers/SviNiWy3Bjc

On 16 April 2017 at 10:58, <j...@yourlabs.org> wrote:

> Hi Adam !
>
> About 1, if it's already working with a non-signal, how could it not work
> with a signal ? It is, after all, called from within formfield() in this
> implementation, so anything that's working today when formfield() is
> called, should work when formfield() emits a signal.
>
> For 2 & 3, yes, I know a lot of hacks exist. I just feel like I've been
> using them for the last decade, to every time replace the default field
> everywhere (forms, admin, drf, etc ...), it really looks like I'm fighting
> that I can't change the default myself.
>
> And this is systematically happening when I have a relation to another
> model, because the default widget does not work well when there is actual
> data in the relations, outside of the testing world where we have only a
> few instances.
>
> Am I really the only witness of this phenomenon ?
>
> <3
>
>> --
> 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/ee180045-fd08-45bd-aced-
> 4a674da80912%40googlegroups.com
> <https://groups.google.com/d/msgid/django-developers/ee180045-fd08-45bd-aced-4a674da80912%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Adam

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

Reply via email to