On 8/18/07, richard <[EMAIL PROTECTED]> wrote: > I'm working on a database-backed Web site which requires a few tables > to use dual primary keys (two columns acted together as primary key; > each of them is not unique in itself). How to do that properly?
> (I'm aware of 'unique_together', however that is not really meant for > primary key creation, is it?) This week it has been discussed here, please see http://mail.google.com/mail/?shva=1&auth=DQAAAHEAAAAPDKjV_WZWyHG_nzwkmFPLgM4zBGeSs_lhf3rWQU9cQMc0kxcg880oaJfAoy3EuZZr_IG5XkcL_Kp48bEWlhNKQCC-p13QrDmrxbIiqzWY7ZhefLIUnAsH86RunSYSmyd434x7-5YSg2_IIapaGRgCMml6xOe411WDaBBJ3862zg ### You could use artificial primary key and form a composite key using unique_together constraint. It could work properly, if Django would create a composite ordinary index, but it unfortunatelly does not. OTOH, if syncdb utility leaves existing tables untouched, you could add such composite index manually on SQL level. --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---