Even if there was provision for that(I don't know), it really wouldn't make
sense. A parent relation tuple can be referenced by multiple child relation
tuples - thereby breaking the uniqueness constraint that comes with a
primary key.

On Wed, Feb 8, 2012 at 10:31 PM, Sandeep kaur <mkaurkha...@gmail.com> wrote:

> Is there any way of having a field in table, declared both as foreign
> key as well as primary key?
> I want something like this in models:
>     publisher = models.ForeignKey(Publisher,primary_key=True)
>
> --
> Sandeep Kaur
> E-Mail: mkaurkha...@gmail.com
> Blog: sandymadaan.wordpress.com
>
> --
> 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.
>
>


-- 
Yati Sagade <http://twitter.com/yati_itay>

(@yati_itay <http://twitter.com/yati_itay>)

-- 
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