{{ user.get_profile.home_address }} should do the trick.
On Mar 17, 4:46 pm, Paolo Corti <[email protected]> wrote:
> Hi
> I know is easy to access to the UserProfile, like here:
>
> from django.contrib.auth.models import User
> u = User.objects.get(pk=1) # Get the first user in the system
> user_address = u.get_profile().home_address
>
> but is there a way to access to UserProfile in the view?
> supposing the UserProfile model is called myprofile, this will not do
> the trick:
>
> {{ user.myprofile.home_address }}
>
> any advice? Thanks
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---