Code

Opened 4 years ago

Closed 4 years ago

#13667 closed (wontfix)

Multiple profile models via AUTH_PROFILE_MODULES (proposal)

Reported by: humanfromearth 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 humanfromearth 4 years ago.
models.py diff SVN format

Download all attachments as: .zip

Change History (5)

comment:1 Changed 4 years ago by anonymous

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

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 4 years ago by erikr

  • Patch needs improvement set

Changed 4 years ago by humanfromearth

models.py diff SVN format

comment:3 Changed 4 years ago by d0ugal

  • Needs documentation set
  • Needs tests set

comment:4 Changed 4 years ago by russellm

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

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.

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.