On Jul 7, 2010, at 7:29 PM, Bruno Rocha wrote:

> 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 '

Unfortunately, none of this explains how the label argument is used in 
IS_IN_DB(), nor is it explained in the manual. And I find the code pretty 
opaque.

How does the above relate to IS_IN_DB?

> 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.


Reply via email to