Really no ideas?

Chris

On 25 Aug., 21:25, "ckar...@googlemail.com" <ckar...@googlemail.com>
wrote:
> Hi,
>
> first, my models:
>
> class Connection(models.Model):
>     p1 = models.ForeignKey(SinglePoint, related_name='p1_set',
> help_text="Punkt 1")
>     p2 = models.ForeignKey(SinglePoint, related_name='p2_set',
> help_text="Punkt 2")
>     ...
>     class Meta:
>         unique_together = (('p1', 'p2'),('p2','p1'))
>
> class SinglePoint(models.Model):
>     name = models.CharField(max_length=100)
>     ...
>
> With that code I can create 2 Connections like:
>
>     Connection 1: p1 = A, p2 = B
>     Connection 2: p1 = B, p2 = A
>
> But I want to disallow that way, I wish to have just
>
>     Connection 1: p1 = A, p2 = B
> OR
>     Connection 2: p1 = B, p2 = A
>
> and not both. How is this possible?
>
> Thank you very much!!
>
> Christian
--~--~---------~--~----~------------~-------~--~----~
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