webmcp
annotate demo-app/model/media_type.lua @ 23:3a6fe8663b26
Code cleanup and documentation added; Year in copyright notice changed to 2009-2010
Details:
- Changed quoting style in auth.openid.xrds_document{...}
- Fixed documentation for auth.openid.initiate{...}
- Added documentation for mondelefant
- Code-cleanup in mondelefant:
-- removed unneccessary lines "rows = PQntuples(res); cols = PQnfields(res);"
-- avoided extra copy of first argument (self) in mondelefant_conn_query
-- no rawget in meta-method "__index" of database result lists and objects
-- removed unreachable "return 0;" in meta-method "__newindex" of database result lists and objects
- Year in copyright notice changed to 2009-2010
- Version string changed to "1.1.1"
Details:
- Changed quoting style in auth.openid.xrds_document{...}
- Fixed documentation for auth.openid.initiate{...}
- Added documentation for mondelefant
- Code-cleanup in mondelefant:
-- removed unneccessary lines "rows = PQntuples(res); cols = PQnfields(res);"
-- avoided extra copy of first argument (self) in mondelefant_conn_query
-- no rawget in meta-method "__index" of database result lists and objects
-- removed unreachable "return 0;" in meta-method "__newindex" of database result lists and objects
- Year in copyright notice changed to 2009-2010
- Version string changed to "1.1.1"
| author | jbe |
|---|---|
| date | Fri Jun 04 19:00:34 2010 +0200 (2010-06-04) |
| parents | 9fdfb27f8e67 |
| children |
| rev | line source |
|---|---|
| jbe/bsw@0 | 1 MediaType = mondelefant.new_class() |
| jbe/bsw@0 | 2 MediaType.table = 'media_type' |
| jbe/bsw@0 | 3 |
| jbe/bsw@0 | 4 MediaType:add_reference{ |
| jbe/bsw@0 | 5 mode = '1m', -- one (1) MediaType is set for many (m) media |
| jbe/bsw@0 | 6 to = "Medium", -- name of referenced model (quoting avoids auto-loading here) |
| jbe/bsw@0 | 7 this_key = 'id', -- own key in media_type table |
| jbe/bsw@0 | 8 that_key = 'media_type_id', -- other key in medium table |
| jbe/bsw@0 | 9 ref = 'media', -- name of reference |
| jbe/bsw@0 | 10 back_ref = 'media_type', -- each autoloaded Medium automatically refers back to the MediaType |
| jbe/bsw@0 | 11 default_order = '"name", "id"' -- order media by SQL expression "name", "id" |
| jbe/bsw@0 | 12 } |