Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default for no matching objects #22

Open
scorpp opened this issue Feb 27, 2023 · 1 comment
Open

Default for no matching objects #22

scorpp opened this issue Feb 27, 2023 · 1 comment

Comments

@scorpp
Copy link

scorpp commented Feb 27, 2023

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.

@AlexHill
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants