Re: [Catalyst] FormFu edit form problem

2009-06-01 Thread Toby Corkindale

Toby Corkindale wrote:
[snip]
 I might be able to get around
this, and the other show-stopper bug[1], by building a custom DBIC 
pseudo-resultset that aggregates several resultsets into one to avoid 
the problems FormFu has with relationships..

[snip]

Ah, bother, this didn't work.
FormFu's introspection of the model doesn't work if some of the columns 
have been brought in via the 'proxy' attribute of a DBIC relationship, 
and FF attempts to call resultset methods on a row object.


Oh well, was worth a try.

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Possible bug here?

2009-06-01 Thread Gordon Yeong
http://linux.wareseeker.com/Programming/template-plugin-page-0.10.zip/328911
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] Re: How to use self made Template Toolkit plugins?

2009-06-01 Thread kakimoto

hi there,
  how do I access the Catalyst variable in a custom made Template
Toolkit plugin?

WhaT I have done: read up on
http://search.cpan.org/src/MRAMBERG/Catalyst-View-TT-0.27/lib/Catalyst/View/TT.pm

For example, I have my own plugin, package
myApp::View::Template::Plugin::User

use strict;
use warnings;
use base 'Template::Plugin';
use Template::Plugin;
use DateTime;
use DateTime::Format::Pg;

sub load {
my ( $class, $context ) = @_;
return $class;
}   

sub new { 
my ( $class, $context, @params ) = @_;

bless { _CONTEXT = $context, }, $class;   # returns blessed
MyPlugin object
}   

sub get_current_user
{
my ($class, $c) = @_;

$c-log-debug( The type is  . ref ($c));

return $c-session-{'active_user'} ? $c-session-{'active_user'} :
$c-user-login_id;
}

===



And in my template toolkit, display_user.tt2 I do something like:

[% current_user = User.get_current_user(Catalyst) %]
THE current user is ([% current_user %])


I noticed that myApp::View::Template::Plugin::User-get_current_user
doesn't print out any values.
I suspect it has not even been able to recognise the Catalyst variable.

 I even tried doing [% current_user = User.get_current_user( $Catalyst
) %] in the display_user.tt2 template file.


 Please help :)


K. akimoto






___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Possible bug here?

2009-06-01 Thread Tomas Doran

Kieren Diment wrote:

On Mon, Jun 1, 2009 at 9:25 AM, J. Shirley jshir...@gmail.com wrote:



Easy for a failing test case, at least ;)


Yeah, it appears to be a backwards compat bug.  The following does
work.  This either needs to be documented or fixed.


Not a back compat bug, it's been there forever (at least, it's there in 
5.7).


Failing test:

http://dev.catalystframework.org/svnweb/Catalyst/revision?rev=10406

This will get fixed in 5.80005

Cheers
t0m

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Re: How to use self made Template Toolkit plugins?

2009-06-01 Thread Tomas Doran

kakim...@tpg.com.au wrote:

hi there,
  how do I access the Catalyst variable in a custom made Template
Toolkit plugin?


You don't want to do this.

TT plugins should be for trivial formatting stuff only, teaching them 
about your application context is massively breaking abstraction.


Cheers
t0m

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Multiple instances of same app with 5.80 under mod_perl

2009-06-01 Thread Tomas Doran

Matthias Dietrich wrote:

Hi,

One solution to this would be to keep a hash of log class instances 
per vhost, and then ensure to replace the logger being used at the 
start of each hit - this should do what you're looking for..


yes, I thought I have to do it in such a way.  Where would be the best 
point to get the right logger?


I'm thinking something like this:

{
my %loggers;
after prepare = sub {
my $class = shift;
my $host = $c-req-hoatname
	my $logger = $loggers{host} ||= My::Logger-new( logfile = 
$class-path_to('logs', $host.log) );

$class-log( $logger );
};
}

(untested)

Cheers
t0m

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Why it is better to use an ORM like DBIx::Class

2009-06-01 Thread Tommy Butler
This was very helpful, thank you.

-- 
Tommy

Octavian Râşniţă wrote:
 Hi,

 I corrected (re-written) that message in which I tried to show why it
 is better to use DBIC, because it doesn't affect the efficiency. Here
 it is. I hope it could be helpful. Please tell me if you think it
 needs improvements:

 Why it is better to use an ORM like DBIx::Class 




signature.asc
Description: OpenPGP digital signature
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Best practice: How to build app parts reusable?

2009-06-01 Thread Matthias Dietrich

Hm, should this be posted on Catalyst-dev?


Am 31.05.2009 um 18:06 schrieb Matthias Dietrich:


Hi,

in one of my Catalyst apps I'm building application parts that I  
want to reuse in other Catalyst apps where possible.  What's the  
best practice to do that?  I mean the complete parts from  
controller, to model, DBIC schema classes and templates.


Let's assume one part is a guestbook (no, it's not but it's a funny  
example ;)).  The integration of the controller class is very easy.   
I just would build a new controller inside the app which uses the  
guestbook controller as base class and sets the correct namespace,  
where the guestbook should appear.  A similar procedure would get me  
the model and schemes into my app, but it requires a wrapper class  
for each class the guestbook brings with.  And the templates?  The  
only way I know of is to copy and paste them into the 'root' folder  
of the app.


There has to be a better way.  But which?

I'm also thinking about whole reusable applications.  For example a  
shopping system which can be extended and modified by overwriting  
methods while the base system can be upgraded seamlessly.  (I know  
MojoMojo as a standalone Catalyst app, but it's only standalone and  
not to be extended locally.)


matt


--
rainboxx Matthias Dietrich
Freier Software Engineer

rainboxx  |  Tel.: +49 (0) 151 / 50 60 78 64
Tölzer Str. 19|  Mail: m...@rainboxx.de
70372 Stuttgart   |  WWW : http://www.rainboxx.de

XING: https://www.xing.com/profile/Matthias_Dietrich18
GULP: http://www.gulp.de/profil/rainboxx.html





PGP.sig
Description: Signierter Teil der Nachricht
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/