Hi Anthony.
This is discussed here:
http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Many-to-many
I've read it before posting. Result was the same as with the code you've
post:
'Rows' object has no attribute 'select'
Now I've update my db as you've suggest:
db.define_table('galleries',
Field('title_en'),
Field('title_it'))
db.define_table('galleries_images',
Field('gallery', 'reference galleries'),
Field('image', 'reference images'))
My controller:
def company():
company_images = db((db.images.id == db.galleries_images.image) &
(db.galleries.id == db.galleries_images.gallery) &
(db.galleries.id == 1)).select()
return dict(company_images=company_images)
Perhaps it's in the view that I have to call filed in another way ?
I've tried with the .select() in the for:
{{for company_image in company_images.select():}}
<li>{{=A(IMG(_src=URL('download',
args=company_image.image_file_s)), _href=URL('download',
args=company_image.image_file))}}>
<span class="ppy-extcaption">
<strong>{{=(company_image.title_it)}}</strong>
</span>
</li>
{{pass}}
Error was :
'Rows' object has no attribute 'select'
And also without the select() in the for:
{{for company_image in company_images:}}
<li>{{=A(IMG(_src=URL('download',
args=company_image.image_file_s)), _href=URL('download',
args=company_image.image_file))}}>
<span class="ppy-extcaption">
<strong>{{=(company_image.title_it)}}</strong>
</span>
</li>
{{pass}}
Error was:
'Row' object has no attribute 'image_file_s'
Can you help me ?
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
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.