Signals - Need a signal after annotations are added

2019-02-23 Thread Mike Brown
I have a situation where I need a signal for when a model object is fully 
instantiated.

Currently, there are signals for pre_init and post_init. However, when 
post_init is fired, 
the object is not fully 'initialized' in the sense that annotations have 
not yet been added to the object.


In django.db.models.query there is class ModelIterable(BaseIterable)

In this class there is code to run a query and then apply annotations.

Should there be a new signal added to Django that is fired after the 
annotations are complete and the object is fully instantiated?

Maybe a signal called 'instantiation_complete'?


-- 
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/bc4516df-71da-429f-af80-7c98a60ab91f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Signals - Need a signal after annotations are added

2019-02-23 Thread Mike Brown

>
>  I think this is a request for a signal that fires after those attributes 
> have been added to the model instances. 
>

Yes.
 

On Saturday, February 23, 2019 at 12:08:43 PM UTC-8, Mike Brown wrote:
>
> I have a situation where I need a signal for when a model object is fully 
> instantiated.
>
> Currently, there are signals for pre_init and post_init. However, when 
> post_init is fired, 
> the object is not fully 'initialized' in the sense that annotations have 
> not yet been added to the object.
>
>
> In django.db.models.query there is class ModelIterable(BaseIterable)
>
> In this class there is code to run a query and then apply annotations.
>
> Should there be a new signal added to Django that is fired after the 
> annotations are complete and the object is fully instantiated?
>
> Maybe a signal called 'instantiation_complete'?
>
>
>

-- 
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/8081596b-26c8-4380-b292-2ba1e77ae61a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.