Opened 18 years ago

Closed 16 years ago

#3644 closed (wontfix)

[multi-db] duplicate model names within one app don't work

Reported by: marc@… Owned by: nobody
Component: Core (Other) Version: other branch
Severity: Keywords: multi-db
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

I'm using multi-db to do versioning, so I have a models_v1 and a models_v2 file with identical model names, and just import one or the other from my models file. If I try to use _both_ model versions at the same time, django won't let me because of the way the models are registered, by class name within an app. So I've modified that to include the module name (the key is now models_v1.classname or just plain models.classname), and this all works ok, as long as _all_ calls to get_model() supply 'models.'+name as the second argument. Patch is attached.

Hope this helps!

Ciao, Marc.

Attachments (2)

multi-db-modelnameconflict.diff (9.9 KB ) - added by marc@… 18 years ago.
patch resolves inability to use duplicate model names within an app
multi-db-modelnameconflict-2.diff (9.5 KB ) - added by marc@… 18 years ago.
cleaned up version

Download all attachments as: .zip

Change History (5)

by marc@…, 18 years ago

patch resolves inability to use duplicate model names within an app

by marc@…, 18 years ago

cleaned up version

comment:1 by Simon G. <dev@…>, 18 years ago

Summary: [multi-db][patch] duplicate model names within one app don't work[multi-db] duplicate model names within one app don't work
Triage Stage: UnreviewedAccepted

comment:2 by James Bennett, 17 years ago

I have a feeling that whatever comes out of #3591 will help with this, even though that's targeted more at app_label.

comment:3 by Malcolm Tredinnick, 16 years ago

Resolution: wontfix
Status: newclosed

Multi-db isn't maintained as a branch. Tickets against it aren't ever going to be fixed directly (although people keep talking about taking different approaches to solve the same problem).

Note: See TracTickets for help on using tickets.
Back to Top