Hi all!

   I've got a model which has a custom manager defined. Model has no
fields, there is only the manager. Here is my code:

from django.contrib.auth.models import User
class MyUserManager(models.Manager):
    def get_query_set(self):
        return User.objects.filter(is_superuser=False)

class MyUser(models.Model):
    objects = MyUserManager()

class MyUserOptions(admin.ModelAdmin):
    pass
    #list_display = ['username', 'first_name']

admin.site.register(MyUser, MyUserOptions)

When I view this model in Admin (newforms-admin) i see a list of
usernames, but I'd like to see username, first_name, last_name etc.
The problem is that list_display (commented out in above example)
doesn't work for me raising:

Exception Type:         AttributeError
Exception Value:        type object 'MyUser' has no attribute 'username'

Is there any way to reach fields from objects returned by my custom
manager?

regards


--
eXt


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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