On Sep 19, 1:50 pm, "J. P. Smyth"
<my.bozo.retarded.work.t...@gmail.com> wrote:
> Someone here wrote:
>
> "Mutli-column composite keys are not currently supported by Django.
> Adding support for multi-column keys (primary or otherwise) is
> something that has been long discussed, and there is agreement that it
> is a desirable feature...."
>
> My problem is that I absolutely must have multi-column keys to create
> a unique primary key.
>
> My primary table consists of a name and part of another column.  Other
> tables are derived from this main table.
>
> I have no idea of how to overcome this obstacle. The table consists of
> the names of companies which are repeated so they're not unique.  The
> entity that would make for a unique key is the name of a company and
> the product id.
>
> Does anyone have a suggestion how I can achieve this unique primary
> key in Django without resorting to creating another column with the
> company name plus the product id?

You don't really say why the default of an integer autofield (Django's
default PK) won't work for you.

Given that, by your own admission, you don't know where to start with
multi-column keys, your not likely to have a pleasant time hacking
into Django's core to do something unsupported in the ORM layer.

-Preston

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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