Opened 19 years ago

Closed 15 years ago

#714 closed enhancement (duplicate)

access to id of current user on admin

Reported by: flavio.curella@… Owned by: Adrian Holovaty
Component: contrib.admin Version: dev
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The model code of admin application doesn't have access to the request, so if I want to save the id of user that is creating the poll, I can't access to it.

this may be more clear, something like this should work:

from django.core import meta
from django.models.auth import User

# Create your models here.
class Poll(meta.Model):

question = meta.CharField(maxlength=200)
pub_date = meta.DateTimeField('date published')
author = meta.ForeignKey(User, default=User.id)
class META:

admin = meta.Admin()

Change History (6)

comment:1 by Flavio.curella@…, 19 years ago

The model code of admin application doesn't have access to the request, so if I want to save the id of user that is creating the poll, I can't access to it.

this may be more clear, something like this should work:

from django.core import meta
from django.models.auth import User

# Create your models here.
class Poll(meta.Model):
    question = meta.CharField(maxlength=200)
    pub_date = meta.DateTimeField('date published')
    author = meta.ForeignKey(User, default=User.id)
    class META:
        admin = meta.Admin()

comment:2 by anonymous, 19 years ago

priority: normalhigh

comment:3 by hugo, 19 years ago

priority: highnormal

a more general approach is discussed in #1132.

comment:4 by Adrian Holovaty, 19 years ago

Resolution: duplicate
Status: newclosed

Superceded by #1132.

comment:5 by Matt Harasymczuk, 15 years ago

Resolution: duplicate
Status: closedreopened
Version: SVN

still no solution
superceded tickets has been marked as wontfix

comment:6 by Russell Keith-Magee, 15 years ago

Resolution: duplicate
Status: reopenedclosed

Please don't reopen tickets closed by a core developer.

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