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
6 sub handler { Apache::MVC::handler(__PACKAGE__, @_) }
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");
12 # Change this to the root of the web space.
13 BeerDB->config->{uri_base} = "http://localhost/beerdb/";
15 BeerDB->config->{rows_per_page} = 10;
17 # Handpumps should not show up.
18 BeerDB->config->{display_tables} = [qw[beer brewery pub style]];
19 BeerDB::Brewery->untaint_columns( printable => [qw/name notes url/] );
20 BeerDB::Style->untaint_columns( printable => [qw/name notes/] );
21 BeerDB::Beer->untaint_columns(
22 printable => [qw/abv name price notes/],
23 integer => [qw/style brewery score/],
26 BeerDB->config->{loader}->relationship($_) for (
27 "a brewery produces beers",
28 "a style defines beers",
29 "a pub has beers on handpumps");