liquid_feedback_frontend
annotate config/default.lua @ 1:dd0109e81922
Version alpha2
Minor bug in bargraph output for suggestions fixed
Minor bug in bargraph output for suggestions fixed
| author | bsw | 
|---|---|
| date | Wed Nov 18 12:00:00 2009 +0100 (2009-11-18) | 
| parents | 3bfb2fcf7ab9 | 
| children | 5c601807d397 | 
| rev | line source | 
|---|---|
| bsw/jbe@0 | 1 config.app_name = "LiquidFeedback" | 
| bsw@1 | 2 config.app_version = "alpha2" | 
| bsw/jbe@0 | 3 | 
| bsw/jbe@0 | 4 config.app_title = config.app_name .. " (" .. request.get_config_name() .. " environment)" | 
| bsw/jbe@0 | 5 | 
| bsw/jbe@0 | 6 config.app_service_provider = "Snake Oil<br/>10000 Berlin<br/>Germany" | 
| bsw/jbe@0 | 7 | 
| bsw/jbe@0 | 8 -- uncomment the following two lines to use C implementations of chosen | 
| bsw/jbe@0 | 9 -- functions and to disable garbage collection during the request, to | 
| bsw/jbe@0 | 10 -- increase speed: | 
| bsw/jbe@0 | 11 -- | 
| bsw/jbe@0 | 12 -- require 'webmcp_accelerator' | 
| bsw/jbe@0 | 13 -- collectgarbage("stop") | 
| bsw/jbe@0 | 14 | 
| bsw/jbe@0 | 15 -- open and set default database handle | 
| bsw/jbe@0 | 16 db = assert(mondelefant.connect{ | 
| bsw/jbe@0 | 17 engine='postgresql', | 
| bsw/jbe@0 | 18 dbname='liquid_feedback' | 
| bsw/jbe@0 | 19 }) | 
| bsw/jbe@0 | 20 at_exit(function() | 
| bsw/jbe@0 | 21 db:close() | 
| bsw/jbe@0 | 22 end) | 
| bsw/jbe@0 | 23 function mondelefant.class_prototype:get_db_conn() return db end | 
| bsw/jbe@0 | 24 | 
| bsw/jbe@0 | 25 -- enable output of SQL commands in trace system | 
| bsw/jbe@0 | 26 function db:sql_tracer(command) | 
| bsw/jbe@0 | 27 return function(error_info) | 
| bsw/jbe@0 | 28 local error_info = error_info or {} | 
| bsw/jbe@0 | 29 trace.sql{ command = command, error_position = error_info.position } | 
| bsw/jbe@0 | 30 end | 
| bsw/jbe@0 | 31 end | 
| bsw/jbe@0 | 32 | 
| bsw/jbe@0 | 33 -- 'request.get_relative_baseurl()' should be replaced by the absolute | 
| bsw/jbe@0 | 34 -- base URL of the application, as otherwise HTTP redirects will not be | 
| bsw/jbe@0 | 35 -- standard compliant | 
| bsw/jbe@0 | 36 request.set_absolute_baseurl(request.get_relative_baseurl()) | 
| bsw/jbe@0 | 37 | 
| bsw/jbe@0 | 38 | 
| bsw/jbe@0 | 39 | 
| bsw/jbe@0 | 40 | 
| bsw/jbe@0 | 41 -- get record by id | 
| bsw/jbe@0 | 42 function mondelefant.class_prototype:by_id(id) | 
| bsw/jbe@0 | 43 local selector = self:new_selector() | 
| bsw/jbe@0 | 44 selector:add_where{ 'id = ?', id } | 
| bsw/jbe@0 | 45 selector:optional_object_mode() | 
| bsw/jbe@0 | 46 return selector:exec() | 
| bsw/jbe@0 | 47 end | 
| bsw/jbe@0 | 48 |