On Aug 18, 2:49 am, Nicolas Aggelidis <n.aggeli...@gmail.com> wrote:
> Thank you for your comments!
>
> > First, there is no need to have the username in the URL if this page
> > is visible only to the logged-in user. Instead, use the request.user
> > object inside your view (and, if necessary, the template).
>
> The idea is that the profile page(what i have in my mind at least) is
> visible to all, but according to if you
> are logged in , it is your profile-home page. Or your friend's and you
> can leave comments,
> for example...

In that case it's best if you set two urls, one with the username for
everyone (loggedin users and others) and one without the username for
loggedinusers only.

> but then where do you use custom tags?

Tags and filters are used to display stuff, not to retrieve it. Think
of custom tags as custom functions for your templates -- when you need
to implement some element(s) on a number of views. Then you put that
element into a custom tag and call it whenever you need it. E.g. I
have implemented a navigation menu as a custom tag.

Note that in many cases custom tags are an overkill and you can
accomplish the same with a simple included template. But with tags you
can do a lot of logic-crunching behind the curtain, which you can0t
with included templates, so chose what fits your situation better.

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

Reply via email to