If your users can belong to only one group, then check this out: -
http://stackoverflow.com/questions/1889607/django-middleware-to-determine-users-group-in-a-session

GBS.

On Jan 10, 1:21 pm, Dave Merwin <[email protected]> wrote:
> Brilliant!! That worked. Thanks.
>
> On Jan 10, 12:19 am, G B Smith <[email protected]> wrote:
>
> > user.groups.all returns not one but (possibly) many objects. Thus you
> > will have to do something like
>
> > {% for group in user.groups.all %}
> >     {% if group.name == 'subscribed' %}
> >        Hello
> >     {% endif %}
> > {% endfor %}
>
> > Regards,
> > GBS
>
> > On Jan 10, 1:12 pm, Dave Merwin <[email protected]> wrote:
>
> > > I'm trying to do something I thought was simple.
>
> > > {% ifequal user.groups "subscribed"  %}
> > >     Hello
> > > {% endifequal %}
>
> > > But it's not working...
>
> > > Any tips?
-- 
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.


Reply via email to