Replies: 2 comments
-
I think this is asking for something I had a question about as well. For example, if we have the following from django.db import models
class Reporter(models.Model):
first_name = models.CharField(max_length=30)
last_name = models.CharField(max_length=30)
email = models.EmailField()
class Article(models.Model):
headline = models.CharField(max_length=100)
pub_date = models.DateField()
reporter = models.ForeignKey(Reporter, on_delete=models.CASCADE) Can an |
Beta Was this translation helpful? Give feedback.
-
Yes you will need to create a custom observer for this. In this blog post there is a custom subscription for a hashtag. If you created a you will also need to create a custom I know the syntax for this is all rather obscure and hard to figure out. I have attempted a few differnt passes at trying to create a more declarative aporach that would be easier to work with but due to the limitations of how django events work and channels so as to avoid loads of extra db lookups I think what is there right now is the best solution. |
Beta Was this translation helpful? Give feedback.
-
Can we write a observer for instances based on foregien key
Beta Was this translation helpful? Give feedback.
All reactions