Hi,

I had a similar problem where the logical solution was to put an
additional attribute to the linking table. But I have not found a solution
besides fetching the data seperatly.

I am also interested how others solved this kind of problem.

Joerg

On Fri, 7 Dec 2012 16:53:06 +0100, "Ekki Plicht (DF4OR)" <e...@plicht.de>
wrote:
> Hi.
> Two tables with a many_to_many relation via a link table:
> 
> Table of web pages:
> table webpage(id, filename, ...)
> 
> Table of images:
> table images (id, filename, ...)
> 
> Table linking pages and images:
> table img_grp_page (id_img, groupnumber, id_page)
> 
> 
> The many_to_many relation works fine, I can retrieve all images
belonging
> to a certain webpage and all webpages where a certain image is used.
> 
> What I want to have is the 'group number' from the link table as well.
> Images are clustered in certain groups on a page, that information is
> represented by that group number.
> 
> Is there a way to get this in one go (one query)?
> 
> Of course I could get this item with a separate query since I know all
> required id's. Still - is there a simpler way? I know that there is a
> similiar phrased question on stackoverflow (not by me), which does not
> really help me.
> 
> 
> TIA,
> Ekki

_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk

Reply via email to