liquid_feedback_frontend
diff model/unit.lua @ 241:6725c13b6ce0
Add initial unit support
author | bsw |
---|---|
date | Fri Dec 30 02:59:43 2011 +0100 (2011-12-30) |
parents | |
children | b77e6a17ca77 |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/model/unit.lua Fri Dec 30 02:59:43 2011 +0100 1.3 @@ -0,0 +1,17 @@ 1.4 +Unit = mondelefant.new_class() 1.5 +Unit.table = 'unit' 1.6 + 1.7 +Unit:add_reference{ 1.8 + mode = '1m', 1.9 + to = "Area", 1.10 + this_key = 'id', 1.11 + that_key = 'unit_id', 1.12 + ref = 'areas', 1.13 + back_ref = 'unit' 1.14 +} 1.15 + 1.16 +function Unit:get_flattened_tree() 1.17 + -- TODO implement 1.18 + 1.19 + return Unit:new_selector():exec() 1.20 +end