config {
    engine          MP13;
    template_engine TT;
    Init            Std           {}
    SQL             Postgres      {}
    Conf            General       {}
    HttpdConf       Gantry        { skip_config 1;
                                    full_use 1;      }
    Control         Gantry        { full_use 0;      }
    Model           GantryCDBI    {}
    SiteLook        GantryDefault {
        gantry_wrapper `/home/pcrow/srcgantry/root/sample_wrapper.tt`;
    }
}
app Apps::AddressBook {
    location `/apps`;
    authors `Phil Crow` => `philcrow2000@yahoo.com`;
    config {
        auth_dbconn    `dbi:Pg:dbname=malcolm`          => no_accessor;
        auth_dbuser    apache                           => no_accessor;
        dbconn    `dbi:Pg:dbname=address`          => no_accessor;
        dbuser    apache                           => no_accessor;
        template_wrapper `wrapper.tt`              => no_accessor;
        root      `/home/pcrow/Bigtop/examples/Apps-AddressBook/html:/home/pcrow/srcgantry/root`
                                                   => no_accessor;
    }
    sequence address_seq        {}
    table    address {
        sequence address_seq;
        foreign_display `%name`;
        field id { is int4, primary_key, assign_by_sequence; }
        field name {
            is             varchar;
            label          Name;
            html_form_type text;
        }
        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;
            html_form_constraint `qr{^\d{5}$}`;
        }
        field phone {
            is             varchar;
            label          Number;
            html_form_type text;
        }
        field email {
            is                 varchar;
            label              `Email Address`;
            html_form_type     text;
            html_form_optional 1;
        }
    }
    sequence birth_seq {}
    table birth {
        sequence birth_seq;
        field id { is int4, primary_key, assign_by_sequence; }
        field name {
            is             varchar;
            label          Name;
            html_form_type text;
        }
        field family {
            is                int4;
            label             Family;
            html_form_type    select;
            refers_to         address;
        }
        field birthday {
            is                date;
            label             Birthday;
            html_form_type    date;
            date_select_text `Popup Calendar`;
        }
    }
    controller Address {
        controls_table   address;
        rel_location     address;
        uses             Gantry::Plugins::AutoCRUD;
        text_description `address`;
        method do_main is main_listing {
            title            `Address`;
            cols             name, phone;
            header_options   Add;
            row_options      Edit, Delete;
        }
        method form is AutoCRUD_form {
            form_name        address;
            all_fields_but   id;
            extra_keys
                legend     => `$self->path_info =~ /edit/i ? 'Edit' : 'Add'`;
        }
    }
    controller Birth {
        controls_table   birth;
        rel_location     birthday;
        uses             Gantry::Plugins::AutoCRUD,
                         Gantry::Plugins::Calendar;
        text_description `birthday`;
        page_link_label  Birthdays;
        method do_main is main_listing {
            title            `Birthday`;
            cols             name, family, birthday;
            header_options   Add;
            row_options      Edit, Delete;
        }
        method _form is AutoCRUD_form {
            form_name        birthday_form;
            all_fields_but   id;
            extra_keys
                javascript => `$self->calendar_month_js( 'birthday_form' )`,
                legend     => `$self->path_info =~ /edit/i ? 'Edit' : 'Add'`;
        }
    }
}
