2010/12/29 Kenneth Lundström <[email protected]>
> Hi Bruno,
>
> waauu what a Plugin your working on, very nice.
>
> What does the productdetails function look like?
In the main table every row has two attributes
ID = it is the record id from rows object, if there is not an id field it
will be the first row value.
Key = tablename.fieldname to query against
In that example the category table is passing i.e: key=products.category.1
cols=[a list of columns to fetch in detail]
the productdetails functions just splits the key and creates a new SQLTABLE
<example>
def productdetails():
tablename,fieldname,value = key.split('.')
return
SQLTABLE(powertable_db(powertable_db.tablename.fieldname==value).select(**cols))
</example>
Following this model it is possible to do whatever you need, bulld any html
object to return in detail table, by default, wthout writing any code i can
return a update/insert FORM, a TABLE, a UL list.
Now I am trying to include tabs within details to return multiple objects.
--
Bruno Rocha
http://about.me/rochacbruno/bio