From b2bf6e98e29ba55c41d134a1e640bdaa560d1152 Mon Sep 17 00:00:00 2001 From: dakkar Date: Wed, 8 Feb 2006 18:52:19 +0000 Subject: funge il modello... ca**o git-svn-id: svn://luxion/repos/IscrittiGroLUG/trunk@170 fcb26f47-9200-0410-b104-b98ab5b095f3 --- GroLUG/lib/GroLUG.pm | 60 +------------------------------------- GroLUG/lib/GroLUG/C/Iscritti.pm | 49 +++++++++++++++++++++++++++++++ GroLUG/lib/GroLUG/M/DB.pm | 27 ++--------------- GroLUG/lib/GroLUG/M/DB/Iscritto.pm | 2 +- 4 files changed, 53 insertions(+), 85 deletions(-) create mode 100644 GroLUG/lib/GroLUG/C/Iscritti.pm (limited to 'GroLUG/lib') diff --git a/GroLUG/lib/GroLUG.pm b/GroLUG/lib/GroLUG.pm index dca5de0..404fde1 100644 --- a/GroLUG/lib/GroLUG.pm +++ b/GroLUG/lib/GroLUG.pm @@ -3,45 +3,12 @@ package GroLUG; use strict; use warnings; -# -# Set flags and add plugins for the application -# -# -Debug: activates the debug mode for very useful log messages -# Static::Simple: will serve static files from the application's root -# directory -# -use Catalyst qw/-Debug ConfigLoader Static::Simple/; +use Catalyst qw/-Debug ConfigLoader Static::Simple DefaultEnd Session Session::Store::DBI Session::State::Cookie/; our $VERSION = '0.01'; -# -# Start the application -# __PACKAGE__->setup; -=head1 NAME - -GroLUG - Catalyst based application - -=head1 SYNOPSIS - - script/grolug_server.pl - -=head1 DESCRIPTION - -Catalyst based application. - -=head1 METHODS - -=cut - -=head2 default - -=cut - -# -# Output a friendly welcome message -# sub default : Private { my ( $self, $c ) = @_; @@ -49,29 +16,4 @@ sub default : Private { $c->response->body( $c->welcome_message ); } -# -# Uncomment and modify this end action after adding a View component -# -#=head2 end -# -#=cut -# -#sub end : Private { -# my ( $self, $c ) = @_; -# -# # Forward to View unless response body is already defined -# $c->forward( $c->view('') ) unless $c->response->body; -#} - -=head1 AUTHOR - -Catalyst developer - -=head1 LICENSE - -This library is free software, you can redistribute it and/or modify -it under the same terms as Perl itself. - -=cut - 1; diff --git a/GroLUG/lib/GroLUG/C/Iscritti.pm b/GroLUG/lib/GroLUG/C/Iscritti.pm new file mode 100644 index 0000000..d79aea6 --- /dev/null +++ b/GroLUG/lib/GroLUG/C/Iscritti.pm @@ -0,0 +1,49 @@ +package GroLUG::C::Iscritti; + +use strict; +use warnings; +use base 'Catalyst::Controller'; + +=head1 NAME + +GroLUG::C::Iscritti - Catalyst Controller + +=head1 SYNOPSIS + +See L + +=head1 DESCRIPTION + +Catalyst Controller. + +=head1 METHODS + +=cut + +# +# Uncomment and modify this or add new actions to fit your needs +# +#=head2 default +# +#=cut +# +#sub default : Private { +# my ( $self, $c ) = @_; +# +# # Hello World +# $c->response->body('GroLUG::C::Iscritti is on Catalyst!'); +#} + + +=head1 AUTHOR + +A clever guy + +=head1 LICENSE + +This library is free software, you can redistribute it and/or modify +it under the same terms as Perl itself. + +=cut + +1; diff --git a/GroLUG/lib/GroLUG/M/DB.pm b/GroLUG/lib/GroLUG/M/DB.pm index 193cb7a..2622de2 100644 --- a/GroLUG/lib/GroLUG/M/DB.pm +++ b/GroLUG/lib/GroLUG/M/DB.pm @@ -10,31 +10,8 @@ my @conn_info = ( { RaiseError => 1, PrintError => 0, ShowErrorStatement => 1, TraceLevel => 0 } ); -__PACKAGE__->load_classes; -#DBIx::Class::Schema->compose_connection( __PACKAGE__, @conn_info ); - -=head1 NAME - -GroLUG::M::DB - DBIC Plain Model Component - -=head1 SYNOPSIS - -See L - -=head1 DESCRIPTION - -DBIC Plain Model Component. - -=head1 AUTHOR - -A clever guy - -=head1 LICENSE - -This library is free software . You can redistribute it and/or modify -it under the same terms as perl itself. - -=cut +__PACKAGE__->load_classes(); +__PACKAGE__->compose_connection(__PACKAGE__,@conn_info); 1; diff --git a/GroLUG/lib/GroLUG/M/DB/Iscritto.pm b/GroLUG/lib/GroLUG/M/DB/Iscritto.pm index 5ae0d33..686b4b2 100644 --- a/GroLUG/lib/GroLUG/M/DB/Iscritto.pm +++ b/GroLUG/lib/GroLUG/M/DB/Iscritto.pm @@ -5,6 +5,6 @@ __PACKAGE__->load_components(qw(PK::Auto::Pg)); __PACKAGE__->table('iscritti'); __PACKAGE__->add_columns(qw(id nome email attivo note)); __PACKAGE__->set_primary_key('id'); -__PACKAGE__->has_many(pagamenti=>'GroLUG::M::DB::Pagamento','iscritto'); +__PACKAGE__->has_many(pagamenti=>'GroLUG::M::DB::Pagamento','iscritto',{order_by => 'data_scadenza desc'}); 1; -- cgit v1.2.3