Just reminded of a problem by this post, how can I validate a unique
pair of nodes like this:

class Edge(models.Model):
        node_a: models.ForeignKey(Node)
        node_b: models.ForeignKey(Node)

I mean if I already have {"node_a": 1, "node_b": 2}, I can't add
{"node_a": 2, "node_b": 1}
How to enforce this restriction efficiently?

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to