Better, you can use signal or model manager with one-to-one relationship
hi, say I have this modelclass Event(models.Model):...metrics = models.OneToOneField("evmetrics.Metrics", on_delete=models.PROTECT,default=Metrics.objects.create)I want to be sure of what I'm writing here, for each new Event object created, a new Metrics object will be create and link to the event by a OneToOne relationship, is there any chance this is really bad code or this could be a problem ?--
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 view this discussion on the web visit https://groups.google.com/d/msgid/django-users/541e8075-0ded-41cd-a565-e552c66a0183n%40googlegroups.com.
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 view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAAmXcB67yeFY%2Bv-ASUKu3bVEUVUPy%3Difz2fehg%2BKmhd7nDkBnw%40mail.gmail.com.
No comments:
Post a Comment