access to id of current user on admin
|Reported by:||Owned by:||Adrian Holovaty|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
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.
question = meta.CharField(maxlength=200)
pub_date = meta.DateTimeField('date published')
author = meta.ForeignKey(User, default=User.id)
admin = meta.Admin()