Hi,

On Mon, Sep 8, 2008 at 12:42 PM, sveri <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> i am using Django 1.0 and try to extent the usermodel, which works so
> far
> for adding new users.
>
> But when i want to retrieve a user profile i get a weird error:
>
> user = get_object_or_404(User, id=9)
> user.get_profile()
>
> Traceback (most recent call last):
>  File "<console>", line 1, in <module>
>  File "/usr/lib/python2.5/site-packages/django/contrib/auth/
> models.py", line 293, in get_profile
>    self._profile_cache =
> model._default_manager.get(user__id__exact=self.id)
> AttributeError: 'NoneType' object has no attribute '_default_manager'
>

Have you imported the User model before trying get_object_or_404?
(f.e. like that):

from django.contrib.auth.models import User



Matthias

--~--~---------~--~----~------------~-------~--~----~
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