liquid_feedback_frontend
annotate model/interest.lua @ 148:034f96181e59
gui part for autosupport
autosupport lets you automaticly support any new draft of an initiative
autosupport lets you automaticly support any new draft of an initiative
author | Daniel Poelzleithner <poelzi@poelzi.org> |
---|---|
date | Fri Oct 08 02:49:53 2010 +0200 (2010-10-08) |
parents | 3bfb2fcf7ab9 |
children | 2f9e1e882de6 |
rev | line source |
---|---|
bsw/jbe@0 | 1 Interest = mondelefant.new_class() |
bsw/jbe@0 | 2 Interest.table = 'interest' |
bsw/jbe@0 | 3 Interest.primary_key = { "issue_id", "member_id" } |
bsw/jbe@0 | 4 Interest:add_reference{ |
bsw/jbe@0 | 5 mode = 'm1', |
bsw/jbe@0 | 6 to = "Member", |
bsw/jbe@0 | 7 this_key = 'member_id', |
bsw/jbe@0 | 8 that_key = 'id', |
bsw/jbe@0 | 9 ref = 'member', |
bsw/jbe@0 | 10 } |
bsw/jbe@0 | 11 |
bsw/jbe@0 | 12 Interest:add_reference{ |
bsw/jbe@0 | 13 mode = 'm1', |
bsw/jbe@0 | 14 to = "Issue", |
bsw/jbe@0 | 15 this_key = 'issue_id', |
bsw/jbe@0 | 16 that_key = 'id', |
bsw/jbe@0 | 17 ref = 'issue', |
bsw/jbe@0 | 18 } |
bsw/jbe@0 | 19 |
bsw/jbe@0 | 20 function Interest:by_pk(issue_id, member_id) |
bsw/jbe@0 | 21 return self:new_selector() |
bsw/jbe@0 | 22 :add_where{ "issue_id = ? AND member_id = ?", issue_id, member_id } |
bsw/jbe@0 | 23 :optional_object_mode() |
bsw/jbe@0 | 24 :exec() |
bsw/jbe@0 | 25 end |