webmcp
annotate demo-app/model/medium.lua @ 11:d76a8857ba62
Added ui.partial and other functions, which allow partial content replacement using XMLHttpRequests; Image support for ui.link
Also includes following changes:
- Fix for rocketcgi library to accept POST data content-types, which contain additional charset information.
- Support arrays passed as params to encode.url (only for keys ending with "[]")
- Version information changed to "1.0.7"
Documentation for added functions is not yet complete.
Also includes following changes:
- Fix for rocketcgi library to accept POST data content-types, which contain additional charset information.
- Support arrays passed as params to encode.url (only for keys ending with "[]")
- Version information changed to "1.0.7"
Documentation for added functions is not yet complete.
author | jbe/bsw |
---|---|
date | Fri Feb 12 18:40:22 2010 +0100 (2010-02-12) |
parents | 9fdfb27f8e67 |
children |
rev | line source |
---|---|
jbe/bsw@0 | 1 Medium = mondelefant.new_class() |
jbe/bsw@0 | 2 Medium.table = 'medium' |
jbe/bsw@0 | 3 |
jbe/bsw@0 | 4 Medium:add_reference{ |
jbe/bsw@0 | 5 mode = 'm1', -- many (m) Medium entries can refer to one (1) MediaType |
jbe/bsw@0 | 6 to = "MediaType", -- name of referenced model (quoting avoids auto-loading here) |
jbe/bsw@0 | 7 this_key = 'media_type_id', -- own key in medium table |
jbe/bsw@0 | 8 that_key = 'id', -- other key in media_type table |
jbe/bsw@0 | 9 ref = 'media_type', -- name of reference |
jbe/bsw@0 | 10 back_ref = nil, -- not used for m1 relation! |
jbe/bsw@0 | 11 default_order = nil -- not used for m1 relation! |
jbe/bsw@0 | 12 } |
jbe/bsw@0 | 13 |
jbe/bsw@0 | 14 Medium:add_reference{ |
jbe/bsw@0 | 15 mode = '1m', -- one (1) Medium has many (m) Classifications |
jbe/bsw@0 | 16 to = "Classification", -- name of referenced model (quoting avoids auto-loading here) |
jbe/bsw@0 | 17 this_key = 'id', -- own key in medium table |
jbe/bsw@0 | 18 that_key = 'medium_id', -- other key in classification table |
jbe/bsw@0 | 19 ref = 'classifications', -- name of reference |
jbe/bsw@0 | 20 back_ref = 'medium', -- each autoloaded classification automatically refers back to the Medium |
jbe/bsw@0 | 21 default_order = '"genre_id"' -- order classifications by SQL expression "genre_id" |
jbe/bsw@0 | 22 } |
jbe/bsw@0 | 23 |
jbe/bsw@0 | 24 Medium:add_reference{ |
jbe/bsw@0 | 25 mode = 'mm', -- many (m) Media belong to many (m) Genres |
jbe/bsw@0 | 26 to = "Genre", -- name of referenced model (quoting avoids auto-loading here) |
jbe/bsw@0 | 27 this_key = 'id', -- (primary) key of medium table |
jbe/bsw@0 | 28 that_key = 'id', -- (primary) key of genre talbe |
jbe/bsw@0 | 29 connected_by_table = 'classification', -- table connecting media with genres |
jbe/bsw@0 | 30 connected_by_this_key = 'medium_id', -- key in classification table referencing media |
jbe/bsw@0 | 31 connected_by_that_key = 'genre_id', -- key in classification table referencing genres |
jbe/bsw@0 | 32 ref = 'genres', -- name of reference |
jbe/bsw@0 | 33 back_ref = nil, -- not used for mm relation! |
jbe/bsw@0 | 34 default_order = '"genre"."name", "genre"."id"' -- mm references need qualified names in SQL order expression! |
jbe/bsw@0 | 35 } |
jbe/bsw@0 | 36 |
jbe/bsw@0 | 37 Medium:add_reference{ |
jbe/bsw@0 | 38 mode = '1m', -- one (1) Medium has many (m) Tracks |
jbe/bsw@0 | 39 to = "Track", -- name of referenced model (quoting avoids auto-loading here) |
jbe/bsw@0 | 40 this_key = 'id', -- own key in medium table |
jbe/bsw@0 | 41 that_key = 'medium_id', -- other key in track table |
jbe/bsw@0 | 42 ref = 'tracks', -- name of reference |
jbe/bsw@0 | 43 back_ref = 'medium', -- each autoloaded classification automatically refers back to the Medium |
jbe/bsw@0 | 44 default_order = '"position"' -- order tracks by SQL expression "position" |
jbe/bsw@0 | 45 } |