Thank very much Malcolm.

I realized that the problem was that I haven't set the User property
in my UserProfile class.

Thanks again.

On Nov 19, 12:39 am, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> On Tue, 2008-11-18 at 18:27 -0800, Mikel Pierre wrote:
> > Hi to all.
>
> > I'm developing my first django app and very happy so far.
>
> > But I've a problem and I was unable to find the solution searching in
> > djangoproject.com and this group.
>
> > I have this in a template:
>
> > <h2>Users list</h2>
> > {% if users %}
> >     <ul>
> >     {% for user in users %}
> >         <li><a href="{{user.get_profile.get_absolute_url}}">
> > {{ user.username }}</a></li>
> >     {% endfor %}
> >     </ul>
> > {% else %}
> >     <p>No users.</p>
> > {% endif %}
>
> > The text link (user.username) shows fine, but the url
> > (user.get_profile.get_absolute_url) are displayed ONLY on the first
> > iteration, I've checked get_absolute_url() and the function is ok.
>
> Do you mean the link is only displayed for the first user? Or the first
> time you display the page?
>
> In either case, I would start by trying to simulate the problem in a
> much simpler environment. Template rendering (deliberately) swallows a
> lot of errors for various reasons, so try to replicate the problem
> outside of a template.
>
> For example, using "manage.py shell", load up a query of users (or even
> a single user) and see what user.get_profile().get_absolute_url() shows
> you. In particular, notice if it shows any error.
>
> If that works without any problem, put some print statements in the view
> function that renders this template. Prior to rendering the template.
> Run through your queryset of users and display
> user.get_profile().get_absolute_url().
>
> Regards,
> Malcolm
--~--~---------~--~----~------------~-------~--~----~
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