@@ 234-251 (lines=18) @@ | ||
231 | ||
232 | ||
233 | ||
234 | @view_config(route_name='user_item_list', |
|
235 | renderer='templates/user/item_list.jinja2', |
|
236 | permission='user') |
|
237 | def item_list(request): |
|
238 | items = DBSession.query(Item)\ |
|
239 | .filter(Item.enabled==True)\ |
|
240 | .filter(Item.in_stock>0)\ |
|
241 | .order_by(Item.name).all() |
|
242 | out_of_stock_items = DBSession.query(Item)\ |
|
243 | .filter(Item.enabled==True)\ |
|
244 | .filter(Item.in_stock==0)\ |
|
245 | .order_by(Item.name).all() |
|
246 | disabled_items = DBSession.query(Item)\ |
|
247 | .filter(Item.enabled==False)\ |
|
248 | .order_by(Item.name).all() |
|
249 | return {'items': items, |
|
250 | 'out_of_stock_items': out_of_stock_items, |
|
251 | 'disabled_items': disabled_items} |
|
252 | ||
253 | ||
254 | @view_config(route_name='user_ajax_item_request_fuzzy', |
@@ 48-63 (lines=16) @@ | ||
45 | return {} |
|
46 | ||
47 | ||
48 | @view_config(route_name='items', renderer='templates/public/items.jinja2') |
|
49 | def items(request): |
|
50 | items = DBSession.query(Item)\ |
|
51 | .filter(Item.enabled==True)\ |
|
52 | .filter(Item.in_stock>0)\ |
|
53 | .order_by(Item.name).all() |
|
54 | out_of_stock_items = DBSession.query(Item)\ |
|
55 | .filter(Item.enabled==True)\ |
|
56 | .filter(Item.in_stock==0)\ |
|
57 | .order_by(Item.name).all() |
|
58 | disabled_items = DBSession.query(Item)\ |
|
59 | .filter(Item.enabled==False)\ |
|
60 | .order_by(Item.name).all() |
|
61 | return {'items': items, |
|
62 | 'out_of_stock_items': out_of_stock_items, |
|
63 | 'disabled_items': disabled_items} |
|
64 | ||
65 | ||
66 |