Open a Python terminal, and try this example
>>> d = {'id':1,'title':'web2py'}
>>> d
{'id': 1, 'title': 'web2py'}
>>> "Title for id %(id)s is %(title)s " % d
'Title for id 1 is web2py '
>>>
2010/7/7 Bruno Rocha <[email protected]>:
> Take a look to the String Formating and String Interpolation in Python
> Documentation
>
> http://docs.python.org/library/stdtypes.html#string-formatting-operations
>
> 2010/7/7 ra3don <[email protected]>:
>> I apologize for a seemingly simple question, but what exactly does '%
>> (title)s' do? I ran across it in the book in the wiki section, the
>> whole line reads.
>>
>> db.document.page_id.requires = IS_IN_DB(db, 'page.id', '%(title)s')
>>
>> Thanks in advance,
>>
>> ra3don.
>>
>
>
>
> --
>
> http://rochacbruno.com.br
>
--
http://rochacbruno.com.br