Code

Opened 7 years ago

Closed 6 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: UI/UX:

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@… 7 years ago.
patch resolves inability to use duplicate model names within an app
multi-db-modelnameconflict-2.diff (9.5 KB) - added by marc@… 7 years ago.
cleaned up version

Download all attachments as: .zip

Change History (5)

Changed 7 years ago by marc@…

patch resolves inability to use duplicate model names within an app

Changed 7 years ago by marc@…

cleaned up version

comment:1 Changed 7 years ago by Simon G. <dev@…>

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Summary changed from [multi-db][patch] duplicate model names within one app don't work to [multi-db] duplicate model names within one app don't work
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 7 years ago by ubernostrum

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 Changed 6 years ago by mtredinnick

  • Resolution set to wontfix
  • Status changed from new to closed

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).

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.