Bigtop

 view release on metacpan or  search on metacpan

lib/Bigtop/Backend/Model.pm  view on Meta::CPAN


=over 4

=item foreign_display

Inside the table, you can include a foreign_display statement.  The
value must be a quoted string like this:

    foreign_display `%last_name, %first_name`;

Any percent and the Perl identifier after it will be replaced with the
current row's values for those columns.  This is useful when a model
needs to deliver a user meaningful value for the current row.

=item model_base_class

This becomes the base class of the model module for this table.
Each backend has a default base model, but setting this overrides it.

=back

lib/Bigtop/Docs/TentRef.pod  view on Meta::CPAN

within the app, but actually point to an external database for the data.
Then, we select not_for SQL.

=item foreign_display

This controls two things: the sort order of items from this table in its
controller's do_main method and the appearance of rows from this table when
other tables' controllers refer to them.  Suppose your table stores data
about people and you want foreign tables to summarize rows with the names
of the people.  You could use this foreign_display: C<%last, %first>.
Anything abutted to the left of a percent sign must be a column in the
table.  Anything else is taken literally.

=item refered_to_by

If other tables have foreign keys to this table, list them here.  Doing
so earns you a has_many relationship, if you use DBIx::Class as your ORM.
The has many name is optional and defaults to the name of the other table
with an 's' appended.

=item model_base_class

lib/Bigtop/Docs/Tutorial.pod  view on Meta::CPAN

It comes after the gernated fields.

    table my_companies {
        # ... generated fields
        foriegn_display `%ident`;

We want to change this from C<`%ident`> to C<`%name`>.

This controls what is displayed when other tables refer to this one.  In
this case, they will see the name of the company.  If there were people
in a table, foreign_display might be C<`%last, %first`>.  So, percent followed
by a column name will be replaced with the value of that column for each
row.  Note that the percent sign in the value requires us to surround
all foreign_display values with backquotes.

We'll use the data statement in the status table below.  The third statement
is useful only if you want to use Postgres sequences.

The rest of the customers table is a set of field blocks.  Like other blocks,
field blocks have this form:

    field name { ... }



( run in 0.373 second using v1.01-cache-2.11-cpan-709fd43a63f )