Multiple Primary Keys

2 views
Skip to first unread message

ojayred

unread,
Mar 17, 2010, 11:21:14 AM3/17/10
to Django users
Hello Users,

I am new to using Django and so far, I like it. I have installed
Django and want to use it with a pre-existing database. Several tables
have multiple primary keys. How do I create the multiple primary keys
in the model? I did use the inspectdb command to help me create the
model because some tables have more than 25 columns. Also, can I run
an SQL module (*.sql file) from Django? Or any suggestions on how to
do so. Thank you for your input.

Ramiro Morales

unread,
Mar 17, 2010, 12:11:48 PM3/17/10
to django...@googlegroups.com
On Wed, Mar 17, 2010 at 12:21 PM, ojayred <ored...@gmail.com> wrote:
> Hello Users,
>
> I am new to using Django and so far, I like it. I have installed
> Django and want to use it with a pre-existing database. Several tables
> have multiple primary keys. How do I create the multiple primary keys
> in the model? I did use the inspectdb command to help me create the
> model because some tables have more than 25 columns.

Unfortunately it isn't supported. See:

http://docs.djangoproject.com/en/1.1/faq/models/#do-django-models-support-multiple-column-primary-keys

--
Ramiro Morales | http://rmorales.net

Reply all
Reply to author
Forward
0 new messages