Thanks, that worked. I think the problem was I wasn't using `auth.user` but
`auth_user`. Full working example:
{{if auth.is_logged_in():}}{{if group[0].id in
auth.user.member_of:}}{{=T('Welcome back Mr
member!')}}{{else:}}{{=T('Become a member today')}}{{pass}}{{pass}}
On Tue, Jul 24, 2012 at 6:28 AM, Anthony <[email protected]> wrote:
> Have you tried:
>
> {{if thisgroupid in auth.user.member_of:}}
>
> Once the user is logged in, auth.user contains the user record from the
> auth_user table, so auth.user.member_of should be the list of
> group_of_events id's for the logged in user.
>
> Anthony
>
>
> On Monday, July 23, 2012 4:20:36 PM UTC-4, Alec Taylor wrote:
>>
>> Yes I do.
>>
>> I have also tried with a bunch of other permutations.
>>
>> Reading through the `Auth` reference, I found a few useful functions,
>> most helpful being:
>> {{=auth._get_user_id()}}
>>
>> Using that I will be able to query the db, but will need to put the
>> reference on the group side rather than the user side. Was planning that
>> (or a two-way reference) anyway.
>>
>> On Tue, Jul 24, 2012 at 5:46 AM, Bruno Rocha <[email protected]>wrote:
>>
>>>
>>> Do you have a member_of field in your auth_user table?
>>>
>>> On Mon, Jul 23, 2012 at 4:40 PM, Alec Taylor <[email protected]>wrote:
>>>
>>>> Just noticed I had underscore instead of point, still isn't working
>>>> though:
>>>> <type 'exceptions.AttributeError'> 'NoneType' object has no attribute
>>>> 'member_of'
>>>> On Tue, Jul 24, 2012 at 5:36 AM, Alec Taylor <[email protected]>wrote:
>>>>
>>>>> On Tue, Jul 24, 2012 at 5:09 AM, Bruno Rocha <[email protected]>wrote:
>>>>>
>>>>>>
>>>>>> there is no request.auth_user by default, did you created this?
>>>>>>
>>>>>> I think you can do (with trunk)
>>>>>>
>>>>>> {{if thisgroupid in auth.user_groups:}}
>>>>>>
>>>>>>
>>>>> Unfortunately that didn't work either... I'm running Version 2.0.0
>>>>> (2012-07-20 17:37:48) dev:
>>>>> <type 'exceptions.NameError'> name 'auth_user' is not defined
>>>>>
>>>>
>>>> --
>>>>
>>>>
>>>>
>>>>
>>>
>>> --
>>>
>>>
>>>
>>>
>>
>> --
>
>
>
>
--