]> git.decadent.org.uk Git - maypole.git/blob - lib/BeerDB.pm
1f673f27ddc6363e6530ae9e5ce880a0d78ee887
[maypole.git] / lib / BeerDB.pm
1 package BeerDB;
2 use base 'Apache::MVC';
3 use Class::DBI::Loader::Relationship;
4 # This line is required if you don't have Apache calling Perl handlers
5 # as methods.
6 sub handler { Apache::MVC::handler(__PACKAGE__, @_) }
7
8 # This is the sample application. Change this to the path to your
9 # database. (or use mysql or something)
10 #BeerDB->set_database("dbi:SQLite:t/beerdb.db");
11 BeerDB->set_database("dbi:mysql:beerdb");
12 # Change this to the root of the web space.
13 #BeerDB->config->{uri_base} = "http://localhost/beerdb/";
14 BeerDB->config->{uri_base} = "http://neo.trinity-house.org.uk/beerdb/";
15
16 BeerDB->config->{rows_per_page} = 10;
17
18 # Handpumps should not show up.
19 BeerDB->config->{display_tables} = [qw[beer brewery pub style]];
20 BeerDB::Brewery->untaint_columns( printable => [qw/name notes url/] );
21 BeerDB::Style->untaint_columns( printable => [qw/name notes/] );
22 BeerDB::Beer->untaint_columns(
23     printable => [qw/abv name price notes/],
24     integer => [qw/style brewery score/],
25     date =>[ qw/date/],
26 );
27 BeerDB->config->{loader}->relationship($_) for (
28     "a brewery produces beers",
29     "a style defines beers",
30     "a pub has beers on handpumps");
31 1;