Opened 6 years ago

Closed 6 years ago

#13667 closed (wontfix)

Multiple profile models via AUTH_PROFILE_MODULES (proposal)

Reported by: Alexandru Plugaru Owned by: nobody
Component: Contrib apps Version: 1.2
Severity: Keywords: user auth profile multiple
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: yes
Needs tests: yes Patch needs improvement: yes
Easy pickings: UI/UX:


I was developing a few apps that required some data stored to users profile. Since now there can be only one model that can be used as a profile and the way around it is somewhat ugly, I've made some changes to get_profile method. In settings instead of:

AUTH_PROFILE_MODULE = "app_label.model"

you can do this:

AUTH_PROFILE_MODULES = ("app_label1.model", "app_label2.model", )

Attachments (1)

models.diff (5.3 KB) - added by Alexandru Plugaru 6 years ago. diff SVN format

Download all attachments as: .zip

Change History (5)

comment:1 Changed 6 years ago by anonymous

Your patch is not properly generated, so trac does not recognize it.

From the contributing document:

Submit patches in the format returned by the svn diff command. An exception is for code changes that are described more clearly in plain English than in code. Indentation is the most common example; it’s hard to read patches when the only difference in code is that it’s indented.

Patches in git diff format are also acceptable.

comment:2 Changed 6 years ago by Erik Romijn

Patch needs improvement: set

Changed 6 years ago by Alexandru Plugaru

Attachment: models.diff added diff SVN format

comment:3 Changed 6 years ago by Dougal Matthews

Needs documentation: set
Needs tests: set

comment:4 Changed 6 years ago by Russell Keith-Magee

Resolution: wontfix
Status: newclosed

My preference would be to deprecate the use of AUTH_PROFILE_MODULES, not enhance it.

The related object manager for OneToOne fields already cache the remote object, so there isn't any caching benefit to had here -- _profile_cache is a historical artefact.

On top of that, you appear to be proposing that we modify get_profile so that it might return multiple objects, depending on the value of a setting.

Marking wontfix. I can't say I'm a fan of this proposal. Feel free to start a discussion on django-dev if you want to advocate for this idea.

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