Monday, August 2, 2010

Re: through/unique_together usage

Each patient can have multiple images. Each image can only be of a
single patient. Have I got the model wrong? Should it be a ForeignKey
in ImageRecord to Patient?

On Jul 29, 6:06 pm, Dennis Kaarsemaker <den...@kaarsemaker.net> wrote:
> On do, 2010-07-29 at 05:35 -0700, Dave wrote:
>
> > In my application I want to enforce a each-image-can-only-be-assigned-
> > to-a-single-patient
>
> So why do you use a ManyToManyField instead of a ForeignKey?
> --
> Dennis K.
>
> They've gone to plaid!

--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment