On 8/14/07, Lars Stavholm <[EMAIL PROTECTED]> wrote:
>
> Hi all,
>
> first of all: django rocks! I'm a database application developer

Glad you like it! Welcome to the community.

> I know that this has been discussed on this list, but what I would
> like to know now is: is there any effort going into creating the
> "multiple fields in the primary key" feature at all? If so, is there
> anything I could do to help, short of trying to implement it myself,
> which I doubt that I'll be able to?
>
> Any input appreciated.

At present, there isn't any effort going on in this area. If you want
to contribute, this would be a very big contribution.

However, be warned - there is a reason we haven't addressed this issue.

On a model level, it shouldn't be too difficult to implement - allow
primary_key=True to be defined on multiple fields, and interpret those
fields appropriately when the table is created. You would also need to
modify the query syntax to ensure that queries over pk accept tuples
rather than just being a simple alias for the primary key field.

You will have more difficulty with the Admin application and generic
views. Both of these features rely upon the ability to install URLs
like:

/path/to/object/42/ -> edit object 42

This works fine if you have a single column primary key; however, if
you have multiple column primary keys, this isn't so easy to do. To
date, every proposed syntax for URL spaces supporting multiple primary
keys has either been syntactically ambiguous (e.g.,
/path/to/object/42,37 - which works unless the primary key has a comma
in it), or very inelegant (/path/to/object/42/37/ - which implies a
heirarchy where there isn't one). Any proposal for adding multiple
primary keys would need to address this very large issue.

Yours,
Russ Magee %-)

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

Reply via email to