I'm new to django and i think it's brilliant except for the weird template
system.

It seems the only way i can write templates which are generic enough to be
reusable is to write complex tags and filters for tasks which could be
handled by a simple argument on a function call, or as a compromise a
workable if check(admittedly in development).

My main problem has been in handling database driven menus which provides
access control depending on the user, showing extra items for staff or
authenticated users. I wanted to avoid the double handling of processing the
model data in the view into lists or querysets, since the menu model is
multi-leveled this would be messy anyway. I think i can do something with
managers, but i'm still not sure how to pass the access data to query sub
menu items.The whole problem is extra weird because i use decorators to send
all the details to the template, but once it's there i can't do much with it
given that i can't make assumptions about user access.

The simplest solution is to hard code the menu generation in python, but of
course that would make me a bad person, so i've been struggling to find a
way to do this very simple thing in templates and my solution was to add
'access'/'endaccess' tags which compare the user in the context with an
access level argument, dropping the block if the user doesn't have access.

It works, but why is it so hard to do something which should be so easy? Am
i missing something?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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