I am using the django User like so:
# models.py
from django.contrib.auth.models import User
class Event(models.Model):
title = models.CharField(maxlength=47)
eventdate = models.DateField()
contact = models.ForeignKey(User, null=True, blank=True )
right now I get this in admin:
<select id="id_contact" class="vNullSelectField" name="contact"
size="1">
<option value="" selected="selected">---------</option>
<option value="83">user1</option>
<option value="131">user2</option>
I get the user1,user2 username because
"If the field is a ForeignKey, Django will display the __str__() of the related
object." http://www.djangoproject.com/documentation/model-api/
(should now say __unicode__ - traced.)
class User(models.Model):
def __unicode__(self):
return self.username
I am hoping to do something like
contact = models.ForeignKey(User, list_display = ('first_name', 'last_name') )
But that throws
ridgemoor.eventcal: __init__() got an unexpected keyword argument 'list_display'
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---