If your doubt is about view syntax, it's just the way you outlined, with a few changes.

1) Change {{T(...)}} by {{=T(...)}}
2) Close the "else" with {{PASS}}

Always remember web2py views can have normal Python code. But don't overuse it, ok?

--
Vinicius Assef


On 07/23/2012 02:55 PM, Alec Taylor wrote:
I'm confused at how I'm meant to do logic checks, e.g. with a test-case
model:

auth.settings.extra_fields['auth_user']=  [Field('member_of',  'list:reference 
db.group_of_events',  requires=IS_IN_DB(db,  db.group_of_events,  
'%(group_name)s',  multiple=True))]

db.define_table(
     'group_of_events',
     Field('group_name',  notnull=True,  requires=[IS_SLUG(),  IS_NOT_IN_DB(db, 
 'group_of_events.group_name')]),
     format='%(group_name)s'
)

And I want to do a check like this in the View:

{{if  thisgroupidin  request.auth_user.member_of:}}
# BTW: I already have the variable: `thisgroupid`
{{T('Welcome back Mr member!')}}
{{else:}}
{{T('Become a member')}}

*How do I perform the aforementioned check in a web2py view?*
*
*
Thanks for all information,

Alec Taylor

--




--



Reply via email to