Thanks Andreas. Sorry I've made a mistake. "Now in the company page, I want to show only images from the "1" gallery."
With "images = db(db.int_table_galleries_images.gallery.id==1).select()" I'm still having all images, also from gallery.id==2. I've also tried with "images = db(db.int_table_galleries_images.gallery<http://db.int_table_galleries_images.gallery.id>==1).select()" (without id). I have all rows. Il giorno mercoledì 30 ottobre 2013 12:42:01 UTC+1, Andreas Wienes ha scritto: > > I'm not sure if I understand you right. What do you mean with "category"? > Maybe you could try this to get all images with a specific gallery-id: > > images = db(db.int_table_galleries_images.gallery.id==1).select() > return dict(images=images) > > > - Andreas > > Am Mittwoch, 30. Oktober 2013 11:51:19 UTC+1 schrieb Gael Princivalle: >> >> >> Hi. >> >> I'm still making a website where I'm gone have to manage a lot of little >> image galleries. >> An image could be shown inside more galleries, galleries have many >> images, so my relation is "many to many". >> >> Here is my db: >> db.define_table('images', >> Field('title_en'), >> Field('title_it'), >> Field('contents'), >> Field('image_file', 'upload'), >> Field('image_file_s', 'upload')) >> db.define_table('galleries', >> Field('title_en'), >> Field('title_it')) >> db.define_table('int_table_galleries_images', >> Field('gallery', 'reference galleries'), >> Field('image', 'reference images')) >> >> Now in the company page, I want to show only images from the "1" category. >> >> In the controller: >> def company(): >> gallery_company = ? >> return dict(gallery_company=gallery_company) >> >> How can I select all fields from images and galleries where galleries.id==1 >> ? >> >> Thanks. >> > -- 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 web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.