Opened 14 years ago

Closed 14 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:

Description

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 14 years ago.
models.py diff SVN format

Download all attachments as: .zip

Change History (5)

comment:1 by anonymous, 14 years ago

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 by Sasha Romijn, 14 years ago

Patch needs improvement: set

by Alexandru Plugaru, 14 years ago

Attachment: models.diff added

models.py diff SVN format

comment:3 by Dougal Matthews, 14 years ago

Needs documentation: set
Needs tests: set

comment:4 by Russell Keith-Magee, 14 years ago

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