config {
    engine MP13;
    template_engine TT;
    Init Std { }
    SQL SQLite {  }
    SQL Postgres {  }
    SQL MySQL {  }
    CGI Gantry { gantry_conf 1; with_server 1; flex_db 1; }
    Control Gantry { dbix 1; }
    Model GantryDBIxClass {  }
    SiteLook GantryDefault {  }
    HttpdConf Gantry { gantry_conf 1; }
    Conf Gantry { instance address; }
}
app AddressBook {
    config {
        dbconn `dbi:SQLite:dbname=/home/pcrow/play/apachesown/app.db` => no_accessor;
        template_wrapper `genwrapper.tt` => no_accessor;
        root `/home/pcrow/play/AddressBook/html` => no_accessor;
    }
    table address {
        field id {
            is int4, primary_key, auto;
        }
        field name {
            is varchar;
            label Name;
            html_form_type text;
            html_form_optional 0;
        }
        field number {
            is varchar;
            label Number;
            html_form_type text;
            html_form_optional 1;
        }
        field created {
            is datetime;
            html_form_optional 1;
        }
        field modified {
            is datetime;
            html_form_optional 1;
        }
        foreign_display `%name`;
        field street {
            is varchar;
            label Street;
            html_form_type text;
            html_form_optional 1;
        }
        field city {
            is varchar;
            label City;
            html_form_type text;
            html_form_optional 1;
        }
        field state {
            is varchar;
            label State;
            html_form_type text;
            html_form_optional 1;
        }
        field zip {
            is varchar;
            label Zip;
            html_form_type text;
            html_form_optional 1;
        }
        field email {
            is varchar;
            label Email;
            html_form_type text;
            html_form_optional 1;
        }
    }
    controller Address is AutoCRUD {
        controls_table address;
        rel_location address;
        text_description address;
        page_link_label Address;
        method do_main is main_listing {
            cols name, number, email;
            header_options Add;
            row_options Edit, Delete;
            title Address;
        }
        method form is AutoCRUD_form {
            all_fields_but id, created, modified;
            extra_keys legend => `$self->path_info =~ /edit/i ? 'Edit' : 'Add'`;
        }
    }
    table bday {
        field id {
            is int4, primary_key, auto;
        }
        field name {
            is varchar;
            label Name;
            html_form_type text;
        }
        field bday {
            is date;
            label Bday;
            html_form_type text;
            date_select_text `Select Date`;
        }
        field created {
            is datetime;
        }
        field modified {
            is datetime;
        }
        foreign_display `%name`;
        field address {
            is int4;
            label Address;
            refers_to address;
            html_form_type select;
        }
    }
    controller Bday is AutoCRUD {
        controls_table bday;
        rel_location bday;
        text_description bday;
        page_link_label Bday;
        method do_main is main_listing {
            cols name, bday;
            header_options Add;
            row_options Edit, Delete;
            title Bday;
        }
        method form is AutoCRUD_form {
            all_fields_but id, created, modified;
            extra_keys legend => `$self->path_info =~ /edit/i ? 'Edit' : 'Add'`, javascript => `$self->calendar_month_js( 'bday' )`;
            form_name bday;
        }
        uses Gantry::Plugins::Calendar;
    }
    literal PerlTop
      `    use lib '/home/pcrow/play/AddressBook/lib';`;
}
