liquid_feedback_frontend
view model/unit.lua @ 281:b77e6a17ca77
Check unit voting right where neccessary, hide action buttons for units without voting right
author | bsw |
---|---|
date | Thu Feb 16 15:01:49 2012 +0100 (2012-02-16) |
parents | 6725c13b6ce0 |
children | c587d8762e62 |
line source
1 Unit = mondelefant.new_class()
2 Unit.table = 'unit'
4 Unit:add_reference{
5 mode = '1m',
6 to = "Area",
7 this_key = 'id',
8 that_key = 'unit_id',
9 ref = 'areas',
10 back_ref = 'unit'
11 }
13 Unit:add_reference{
14 mode = 'mm',
15 to = "Member",
16 this_key = 'id',
17 that_key = 'id',
18 connected_by_table = 'privilege',
19 connected_by_this_key = 'unit_id',
20 connected_by_that_key = 'member_id',
21 ref = 'members'
22 }
24 function Unit:get_flattened_tree()
25 -- TODO implement
27 return Unit:new_selector():exec()
28 end