format='(%(mountain.x)s %(mountain.y)s) %(pos)s'

If "format" is a string, it can only include the names of fields within the 
current table (e.g., "mountain").

Anthony

On Sunday, March 31, 2013 9:48:47 AM UTC-4, Vladimir Kaznacheev wrote:
>
>
> in *db.py*
> db.define_table('mountains',
>     Field('m_id','integer', required=True),
>     Field('pos','integer'),
>     Field('x','integer'),
>     Field('y','integer'),
>     format='(%(x)s %(y)s)',
> )
>
> db.define_table('dungeons',
>     Field('d_id','integer', required=True),
>     Field('mountain', 'reference mountains', notnull=True), 
>     Field('pos','integer'),
>     format='(%(mountain.x)s %(mountain.y)s) %(pos)s',
> )
>
> db.define_table('dungeon_resources',
>     Field('dungeon', 'reference dungeons', required=True, notnull=True),
>     Field('mine', 'string'),
>     Field('quantity', 'integer'),
> )
>
>
> in *controllers/default.py*
> def ResourceMap():
>     form = SQLFORM.grid(db.dungeon_resources, searchable=True, 
> create=False, editable=False, deletable=False, details=False)
>     return dict(form=form)
>
> when i try open *http://<app>/default/ResourceMap* i get error ticket
> <type 'exceptions.AttributeError'> 'Table' object has no attribute 
> 'mountain.x'
>
> without *format* in *db.define_table* table displays, but it is not 
> informative
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to