]> git.decadent.org.uk Git - maypole.git/blob - lib/BeerDB.pm
This makes it all work as Maypole.
[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 { Maypole::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
13 # Change this to the root of the web space.
14 #BeerDB->config->{uri_base} = "http://localhost/beerdb/";
15 BeerDB->config->{uri_base} = "http://neo.trinity-house.org.uk/beerdb/";
16
17 BeerDB->config->{rows_per_page} = 10;
18
19 # Handpumps should not show up.
20 BeerDB->config->{display_tables} = [qw[beer brewery pub style]];
21 BeerDB::Brewery->untaint_columns( printable => [qw/name notes url/] );
22 BeerDB::Style->untaint_columns( printable => [qw/name notes/] );
23 BeerDB::Beer->untaint_columns(
24     printable => [qw/abv name price notes/],
25     integer => [qw/style brewery score/],
26     date =>[ qw/date/],
27 );
28 BeerDB->config->{loader}->relationship($_) for (
29     "a brewery produces beers",
30     "a style defines beers",
31     "a pub has beers on handpumps");
32 1;