Hi,

I'm write a model for a post.

Can I access to id of current user on admin site?

I'm trying with:

author = models.ForeignKey(User, default=User.id, blank=True, null=True)

But don' work...

Thanks,

Alfredo

----------------------------------
from django.db import models
from django.contrib.auth.models import User
from django.forms import ModelForm


class Post(models.Model):
    title = models.CharField(max_length=30)
    author = models.ForeignKey(User, default=User.id, blank=True, null=True)

---------------------------------------------

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to