>I need to show a selection(not all but specific ones) of the Pictures on 
the Book/Movie page. So a refrence back to the Image table 
> would be awesome.

I'd use an intermediate table for that. Something like

defnine_table("image_references", Field("image_id", "reference image"), 
Field("referenced_table"), Field("referenced_id", "integer"))

#Then you can link an image to another object with:
db.image_references.insert(image_id=<id>, referenced_table="book", 
referenced_id=<id>)

# Now retrieve all images from The Count of Montecristo
montecristo = db(db.book.name=="The Count of 
Montecristo").select().first().id
images = 
db((db.image_references.referenced_table=="book")&(db.referenced_id==montecristo)).select()


-- 

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