From 78cd23f9bf8e7640ecb6126c3b3ea4e9857af77e Mon Sep 17 00:00:00 2001 From: Gryllida A Date: Sun, 3 Feb 2013 13:13:38 +1030 Subject: [PATCH] remove redundant comments --- lib/Slists/Controller/Lists.pm | 43 +++++++----------------------------------- 1 file changed, 7 insertions(+), 36 deletions(-) diff --git a/lib/Slists/Controller/Lists.pm b/lib/Slists/Controller/Lists.pm index eeaec52..462763e 100644 --- a/lib/Slists/Controller/Lists.pm +++ b/lib/Slists/Controller/Lists.pm @@ -145,37 +145,12 @@ This one is very similar to list, but it lists list items, not lists. =cut sub view :Chained('object') :PathPart('view') :Args(0) { - -# sqlite> select * from list_items left join products -# on products.id = list_items.product_id where list_items.list_id=1; -# 1|1|1|1|1|potatoes|4.0|5.0 -# list item id -# list item product quantity -# list item product id -# list item list id -# product id -# product name -# product weight -# product price - my ($self, $c) = @_; + # get list id my $id = $c->stash->{object}->id; -# $c->stash(list_items => [$c->model('DB::ListItem')->search({ -# list_id => $id, -# })->all -# ]); - -# $c->model('DB::Users')->search( - # { 'role.role' => 'friend' }, - # { - # join => { 'map_user_role' => 'role' }, - # '+select' => [ 'role.id', 'role.role' ], - # '+as' => [ 'roleid', 'role' ], - # rows => 10, - # }, -# ); - - $c->stash(list_items => [$c->model('DB::ListItem')->search( + + # get list item info from database + $c->stash(list_items => [$c->model('DB::ListItem')->search( { 'list_id' => $id }, { join => {'products' => 'products' }, @@ -184,13 +159,9 @@ sub view :Chained('object') :PathPart('view') :Args(0) { }, { 'pid' => 'product_id' }, )->all - ]); - - # my $rs = $schema->resultset('CD')->search( - # { 'artist.name' => 'Nine Inch Nails' }, - # { join => 'artist' } - # ); - + ]); + + # use template $c->stash(template => 'lists/view.tt2'); } -- 2.11.4.GIT