Seth wrote:
> user.get_profile() does in fact return the custom profile object.
>
> The problem is that the custom profile object is either
> contact.Contact or myApp.myProfile.  Never are both accessible.
>
> The way I was most hopeful about was to extend the Contact model with
>
> class myProfile(models.Model):
>      contact = models.ForeignKey(User, unique=True)
>      otherInfo = models.CharField()
>
> AUTH_PROFILE_MODULE = "myApp.myProfile"
>
> But with that setup
> User.objects.get(pk=1).get_profile()
>
> errors out with "Cannot resolve keyword 'user' into field. Choices
> are: contact, id, otherInfo"
>
> And if I change to
> AUTH_PROFILE_MODULE = "contact.Contact"
>
> user.get_profile().industry
> errors out with "'Contact' object has no attribute 'industry'"
>
> and
> user.get_profile().myProfile
> errors out with "'Contact' object has no attribute 'myProfile'
>
> Am I wrong to think that it's possible to have contact.Contact and
> myapp.myProfile accessible through user.get_profile()?
>
>    
Yes. You cannot register both as the AUTH_PROFILE_MODULE

And your Model def is slightly incorrect:

class myProfile(models.Model):
     user = models.ForeignKey(User, unique=True)
     otherInfo = models.CharField()

Notice the change? That ForeignKey needs to be called 'user', not 'contact'.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Satchmo 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/satchmo-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to