liquid_feedback_frontend
view model/draft.lua @ 415:2113a6bb597d
Show private nav items only when logged in
| author | bsw | 
|---|---|
| date | Sat Mar 10 17:09:10 2012 +0100 (2012-03-10) | 
| parents | 23c98752e697 | 
| children | 24f4c23f76ff | 
 line source
     1 Draft = mondelefant.new_class()
     2 Draft.table = 'draft'
     4 -- Many drafts belonging to an initiative
     5 Draft:add_reference{
     6   mode          = 'm1',
     7   to            = "Initiative",
     8   this_key      = 'initiative_id',
     9   that_key      = 'id',
    10   ref           = 'initiative',
    11 }
    13 -- Many drafts are authored by a member
    14 Draft:add_reference{
    15   mode          = 'm1',
    16   to            = "Member",
    17   this_key      = 'author_id',
    18   that_key      = 'id',
    19   ref           = 'author',
    20 }
    22 function Draft.object_get:author_name()
    23   return self.author and self.author.name or _"Unknown author"
    24 end
    26 model.has_rendered_content(Draft, RenderedDraft)
