Figured it out. Apparently when I did my intial test I did not have a
profile create for the user which was causing a different error.
the correct string was 'engine.UserProfile'
Justin
On Aug 19, 10:11 am, Justin wrote:
> I am sure this is a newbie mistake but I can't seem to find exactly
> the right setting. I have create a user profile class. I am trying
> to attach into my django project via the AUTH_PROFILE_MODULE setting
> in the settings.py file.
>
> The error I get is as follows when I try to retrieve the profile>>> from
> django.contrib.auth.models import User
> >>> from engine.models import *
> >>> user = User.objects.get(pk=1)
> >>> prof = user.get_profile()
>
> Traceback (most recent call last):
> File "", line 1, in
> File "/usr/local/lib/python2.6/dist-packages/django/contrib/auth/
> models.py", line 285, in get_profile
> self._profile_cache = model._default_manager.get
> (user__id__exact=self.id)
> AttributeError: 'NoneType' object has no attribute '_default_manager'
>
> My AUTH_PROFILE_MODULE = 'engine.UserProfile'
>
> Rough project layout
>
> /logi - site folder
> /logi/engine/models model folder
> /logi/engine/views views folder
>
> The userprofile exists within the /logi/engine/models folder in a file
> call models_file.py. so the full path to my user profile class is /
> logi/engine/models/models_file.py
>
> I have tried several variations of the AUTH_PROFILE_MODULE string but
> none seems to work.
> engine.UserProfile
> models.UserProfile
> logi.UserProfile
>
> User Class as defined
> class UserProfile(models.Model):
>
> panel_id = models.IntegerField()
> email = models.EmailField()
> status = models.CharField(max_length=1)
> user = models.ForeignKey(User, unique=True)
>
> def __unicode__(self):
> return "%s - %s" % (self.panel_id, self.email)
>
> class Meta:
> app_label = 'engine'
>
> Any help would be appreciated,
> I am sure this is something simple.
>
> Thanks,
> Justin
--~--~-~--~~~---~--~~
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
django-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---