Hi Anthony,

The idea of some form-related signals has previously been suggested, and
there's an open ticket: https://code.djangoproject.com/ticket/27923 and the
mailing list thread:
https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/django-developers/SviNiWy3Bjc/fqFL8rZvBAAJ
.
Near the end of that thread, you can see David had an example fork
implemetning the signals.

It seems the PR author luojiebin is unlikely to come back to it, so if
you're willing to take over with a new PR, that would be great! See the
guide at https://docs.djangoproject.com/en/dev/internals/contributing/

The discussion around exactly which signals to add didn't come to a real
conclusion then but I think starting with less than all 6 in luojiebin's PR
is probably best. It seems the post_save signal would be all you need for
your use case?

Thanks,

Adam

On Wed, 4 Sep 2019 at 21:04, Anthony Goslar <anthony.gos...@gmail.com>
wrote:

> The post_save signal doesn't return the data written to the database. I
> have a project where I need to use a newly created instance to create a
> number of new instances in other models based on the current saved data. I
> can't however call the data in the current instance using the post_save
> signal, especially when I try to use the signals with a m2m intermediate
> model.
>
> My work around has been to add a signal into the views after my obj.save()
> and call for the newly saved instance as newly_saved_instance=obj.save()
> and then put that into my function using a custom signal.
>
> It took a long time to find the source of my issues as the system threw
> back no errors. In fact the DEBUG loggers didn't register what I was trying
> to do with the signals.
>
> Would it be useful to have a post_form & pre_form signal which fires
> around the forms? Of course the custom signals can always be written but it
> seems like something which may be useful for a number of users.
>
> Thanks!
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/7bd40d61-fcf7-44b9-be51-c30c13caf580%40googlegroups.com
> .
>


-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAMyDDM2mGL_E%2BZxN%3D7XOXP3QuOUp%2B7iMBqFp8-g8ZRceOefiuA%40mail.gmail.com.

Reply via email to