Tuesday, June 25, 2019

Re: Signals with update()

If what I said is confusing, let me know where. I've been stuck on this for a looonngg time. 

On Tuesday, June 25, 2019 at 10:34:25 AM UTC-4, Yoo wrote:
Hi, I have a problem with updating in Django signals regarding a specific use-case hierarchy:


Hi, so here's the problem: once the objects for Public1 are created, I need to update each object in the queryset of Private1 of a1 to have their publicized_id be equal to the new object's id. Like a ForeignKey. So for Object 1 of a1, a new record in Public1 should be made that have the exact same fields as Object 1; this new record will be called NewObj 1. So, once the new record is saved, I need to update Object 1's publicized_id to be equal to the id of NewObj1. This goes on forever with Object 2 having publicized_id equal to NewObj 2's id. Maybe, instead of publicized_id being a CharField, it can be a ForeignKey?


How would I implement this update() into the signal?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/ff6f61f1-f1cb-4c2d-ac64-7bb28e3f5df5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment