From: Simon Cozens Date: Thu, 19 Feb 2004 13:49:22 +0000 (+0000) Subject: Distinguish between all columns, and the ones you want to display, in X-Git-Tag: 2.10~296 X-Git-Url: https://git.decadent.org.uk/gitweb/?p=maypole.git;a=commitdiff_plain;h=053b67100478267d34ac98094af3af742098f5fe Distinguish between all columns, and the ones you want to display, in the right order. git-svn-id: http://svn.maypole.perl.org/Maypole/trunk@66 48953598-375a-da11-a14b-00016c27c3ee --- diff --git a/lib/Maypole/Model/Base.pm b/lib/Maypole/Model/Base.pm index c4c959f..12bb71d 100644 --- a/lib/Maypole/Model/Base.pm +++ b/lib/Maypole/Model/Base.pm @@ -13,6 +13,10 @@ sub process { $class->$method($r); } +sub display_columns { + sort shift->columns; +} + =head1 NAME Maypole::Model::Base - Base class for model classes @@ -70,7 +74,9 @@ beers, so C needs to return C. =head2 columns -This is a list of the columns in a table. +This is a list of all the columns in a table. You may also override +C, which is the list of columns you want to view, in +the right order. =head2 table diff --git a/lib/Maypole/View/TT.pm b/lib/Maypole/View/TT.pm index 3c2e05f..834fcaf 100644 --- a/lib/Maypole/View/TT.pm +++ b/lib/Maypole/View/TT.pm @@ -34,7 +34,7 @@ sub _args { if ($class) { $args{classmetadata} = { name => $class, - columns => [ $class->columns ], + columns => [ $class->display_columns ], colnames => { $class->column_names }, related_accessors => [ $class->related($r) ], moniker => $class->moniker,