django-relativity
django-relativity copied to clipboard
Default for no matching objects
It would be nice if one can specify a value/callable to use when no related objects match predicate.
In our system there is part where we classify traffic by some key. If there is no match for the key we consider it an Organic Traffic.
Unfortunately it's not possible to implement this business rule with just predicate itself.
Hi @scorpp, thanks for your feedback.
Can you give me a more concrete idea of the models and Relationships between them in your system, and the behaviour of your proposed change to the django-relativity API?
At least initially, this sounds beyond the scope of this project - the idea of the Relationship field is to be as consistent with the Django ORM's relation fields as possible from the perspective of application code. But I'm open to being convinced.