From 053b67100478267d34ac98094af3af742098f5fe Mon Sep 17 00:00:00 2001 From: Simon Cozens Date: Thu, 19 Feb 2004 13:49:22 +0000 Subject: [PATCH] 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 --- lib/Maypole/Model/Base.pm | 8 +++++++- lib/Maypole/View/TT.pm | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) 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, -- 2.39.5