Re: [Catalyst] PathPart help

2007-11-15 Thread Peter Karman


Les Fletcher wrote on 11/15/07 1:47 PM:
> I have question about setting up PathPart's and Chaining.  I am trying
> to set something that has the following look:
> 
> /namespace/ => This lists out a list of objects
> /namespace/ => displays detail information about the object with the
> numeric id=
> /namespace//edit => brings up a form to edit object with numeric
> id=
> /namespace/create => brings up a form to create a new object
> 

This controller implements that exact API:

http://search.cpan.org/~karman/Catalyst-Controller-Rose-0.04/lib/Catalyst/Controller/Rose/CRUD.pm

-- 
Peter Karman  .  http://peknet.com/  .  [EMAIL PROTECTED]

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


Re: [Catalyst] PathPart help

2007-11-15 Thread Les Fletcher
That one seems to use as explicit "view" at the end of the url instead 
of having the identifier be the last piece of the url.


Peter Karman wrote:

Les Fletcher wrote on 11/15/07 1:47 PM:
  

I have question about setting up PathPart's and Chaining.  I am trying
to set something that has the following look:

/namespace/ => This lists out a list of objects
/namespace/ => displays detail information about the object with the
numeric id=
/namespace//edit => brings up a form to edit object with numeric
id=
/namespace/create => brings up a form to create a new object




This controller implements that exact API:

http://search.cpan.org/~karman/Catalyst-Controller-Rose-0.04/lib/Catalyst/Controller/Rose/CRUD.pm

  


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


Re: [Catalyst] Switching between different databases during a session

2007-11-15 Thread Peter Karman


Andrew Peebles wrote on 11/15/07 7:16 PM:
> I've been searching and experimenting and have not found a solution ...
> 
> I have multiple instances of a database (each in a separate sqlite db
> file), same schema, different data.  Each represents a snapshot of
> something at a particular time.  During a session, user wants switch
> among these databases.  I am trying to add a method to my Model
> (Catalyst::Model::DBIC::Schema) that takes a new connection string, and
> switches to that database ... all things otherwise remaining the same. 
> Seems relatively simple, but I just ain't getting it.  Lots of hints on
> the list, but nothing I can find that's helping.
> 

why not have a different Model class for each db?

-- 
Peter Karman  .  http://peknet.com/  .  [EMAIL PROTECTED]

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


[Catalyst] Switching between different databases during a session

2007-11-15 Thread Andrew Peebles

I've been searching and experimenting and have not found a solution ...

I have multiple instances of a database (each in a separate sqlite db 
file), same schema, different data.  Each represents a snapshot of 
something at a particular time.  During a session, user wants switch 
among these databases.  I am trying to add a method to my Model 
(Catalyst::Model::DBIC::Schema) that takes a new connection string, and 
switches to that database ... all things otherwise remaining the same.  
Seems relatively simple, but I just ain't getting it.  Lots of hints on 
the list, but nothing I can find that's helping.


I've tried a lot of variants on something like this:

package SMART::Model::SMARTDB;

use strict;
use base 'Catalyst::Model::DBIC::Schema';

my $dsn = $ENV{MY_DSN} ||= 
'dbi:SQLite:/auto/project/tools/metadot/html/cgi/SMART/smart.db';


__PACKAGE__->config(
   schema_class => 'SMARTDB',
   connect_info => [
   $dsn,
   '',
   '',
   {AutoCommit => 1},
  
   ],

);

sub switch {
   my $self = shift;
   my $dsn  = shift;

   my $connect_info = [ @{$self->{connect_info}} ];
   $$connect_info[0] = $dsn;

   my $schema = $self->clone();
   $schema->connection(@$connect_info);
   $self->schema($schema);
}

1;


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


Re: [Catalyst] Switching between different databases during a session

2007-11-15 Thread James R. Leu
I've implemented something along the lines of what your doing, but to
suite a slightly different purpose.

Instead of searching different databases based on time I need to take
one query and run it against a dynamic list of databases and return the
results as one resultset.  The list of databases is determined by users
permissions.

I'll give you an overview of how I did it, and you can decide if it will
work for you.  I got the starter info about how to do this from the
people on this list.

I've created 'template' DBIx modules that inherit from DBIx::Class.
These are standard DBIx::Class definitions except the table
name is a sprintf format, and I register a 'source_name'

I've defined 'template' Catalyst Models that inherit from
Catalyst::Model::DBIC::Schema and list the source_name's from
'template' DBIx modules as the schema_class's.  I then include the
connect_info which for me is standard, but this could be 'templated' too.

I've created a module called Catalyst::Model::Multi.  This module
has logic for registering 'child' models, and then mapping standard
resultset operations to each of the registered children and aggregating
the results.  Much of he code is spent trying to do standard resultset
stuff in a way that makes sense with multiple resultset to pull from.

I have a parent model in my application that inherits from
Catalyst::Model::Multi. In the COMPONENT method I build the full list
of 'child' models that might be needed by individual sessions.
The COMPONENT method is called during application start up, so I build
the full list just one, and each request refers to that list. The
child models are build by calling MyApp::Model::FooDB->COMPONENT($c)
where FooDB is the name of one of the 'template' Catalyst Models.  I
then dig through schema and sources of this model replacing table names
(by using the sprintf formats). I believe you could change the connection
info at this time as well.  I then register these instance of the
'template' Catalyst Model as children of my parent, using a unique name.

During authentication process for a session I build he list of unique names
for child models that will be needed by the session.

As each request comes in ACCEPT_CONTEXT is called on the parent model.
For that request I pull the list of unique names from the session
data and register them with the parent model as where to look when
I make queries to that parent mode for this session.

In my application I refer only to the parent model, never the 'template'
Catalyst Models.

My guess is you could use a similar scheme but instead of using my
Catalyst::Model::Multi, you'd write your own that knows how to
query the various model based on time.

On Thu, Nov 15, 2007 at 05:16:58PM -0800, Andrew Peebles wrote:
> I've been searching and experimenting and have not found a solution ...
> 
> I have multiple instances of a database (each in a separate sqlite db 
> file), same schema, different data.  Each represents a snapshot of 
> something at a particular time.  During a session, user wants switch 
> among these databases.  I am trying to add a method to my Model 
> (Catalyst::Model::DBIC::Schema) that takes a new connection string, and 
> switches to that database ... all things otherwise remaining the same.  
> Seems relatively simple, but I just ain't getting it.  Lots of hints on 
> the list, but nothing I can find that's helping.
> 
> I've tried a lot of variants on something like this:
> 
> package SMART::Model::SMARTDB;
> 
> use strict;
> use base 'Catalyst::Model::DBIC::Schema';
> 
> my $dsn = $ENV{MY_DSN} ||= 
> 'dbi:SQLite:/auto/project/tools/metadot/html/cgi/SMART/smart.db';
> 
> __PACKAGE__->config(
>schema_class => 'SMARTDB',
>connect_info => [
>$dsn,
>'',
>'',
>{AutoCommit => 1},
>   
>],
> );
> 
> sub switch {
>my $self = shift;
>my $dsn  = shift;
> 
>my $connect_info = [ @{$self->{connect_info}} ];
>$$connect_info[0] = $dsn;
> 
>my $schema = $self->clone();
>$schema->connection(@$connect_info);
>$self->schema($schema);
> }
> 
> 1;
> 
> 
> ___
> List: Catalyst@lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/[EMAIL PROTECTED]/
> Dev site: http://dev.catalyst.perl.org/

-- 
James R. Leu
[EMAIL PROTECTED]


pgpy4F4lhIdql.pgp
Description: PGP 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/[EMAIL PROTECTED]/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Switching between different databases during a session

2007-11-15 Thread Andrew Peebles

Andrew Peebles wrote:

I've been searching and experimenting and have not found a solution ...

I have multiple instances of a database (each in a separate sqlite db 
file), same schema, different data.  Each represents a snapshot of 
something at a particular time.  During a session, user wants switch 
among these databases.  I am trying to add a method to my Model 
(Catalyst::Model::DBIC::Schema) that takes a new connection string, 
and switches to that database ... all things otherwise remaining the 
same.  Seems relatively simple, but I just ain't getting it.  Lots of 
hints on the list, but nothing I can find that's helping.


I've tried a lot of variants on something like this:

package SMART::Model::SMARTDB;

use strict;
use base 'Catalyst::Model::DBIC::Schema';

my $dsn = $ENV{MY_DSN} ||= 
'dbi:SQLite:/auto/project/tools/metadot/html/cgi/SMART/smart.db';


__PACKAGE__->config(
   schema_class => 'SMARTDB',
   connect_info => [
   $dsn,
   '',
   '',
   {AutoCommit => 1},
 ],
);

sub switch {
   my $self = shift;
   my $dsn  = shift;

   my $connect_info = [ @{$self->{connect_info}} ];
   $$connect_info[0] = $dsn;

   my $schema = $self->clone();
   $schema->connection(@$connect_info);
   $self->schema($schema);
}

1;


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: 
http://www.mail-archive.com/[EMAIL PROTECTED]/

Dev site: http://dev.catalyst.perl.org/
Well ... in fact the code above works like a charm.  I had a problem in 
another part of my environment that was making this look like it didn't 
work, but it does.  Be nice to add this piece of code to one of the 
Cookbooks somewhere, maybe.

a


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


Re: [Catalyst] Switching between different databases during a session

2007-11-15 Thread Andrew Peebles




Peter Karman wrote:

  
Andrew Peebles wrote on 11/15/07 7:16 PM:
  
  
I've been searching and experimenting and have not found a solution ...

I have multiple instances of a database (each in a separate sqlite db
file), same schema, different data.  Each represents a snapshot of
something at a particular time.  During a session, user wants switch
among these databases.  I am trying to add a method to my Model
(Catalyst::Model::DBIC::Schema) that takes a new connection string, and
switches to that database ... all things otherwise remaining the same. 
Seems relatively simple, but I just ain't getting it.  Lots of hints on
the list, but nothing I can find that's helping.


  
  
why not have a different Model class for each db?

  

There could be an arbitrary number of them, databases are added over
time.  They are identical; same schema, tables, et. al (same model).

a



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


Re: [Catalyst] PathPart help

2007-11-15 Thread Les Fletcher

I am using

__PACKAGE__->config->{ namespace } = 'foo';

sub obj_setup :  PathPart('') CaptureArgs(1) {}
sub create_setup : PathPart('') CaptureArgs(0) {}

sub view : PathPart('') Chained('obj_setup') Args(0) {}
sub edit : PathPart('') Chained('obj_setup') Args(0) {}
sub create : PathPart('create') Chained('create_setup') Args(0) { }

The thing I don't understand is that when the Chained actions are 
printed out, it gives me the correct actions as I would expect them.  
The create one just doesn't get matched.


Les

Christopher H. Laco wrote:

Christopher H. Laco wrote:
  

Les Fletcher wrote:


I have question about setting up PathPart's and Chaining.  I am trying
to set something that has the following look:

/namespace/ => This lists out a list of objects
/namespace/ => displays detail information about the object with the
numeric id=
/namespace//edit => brings up a form to edit object with numeric
id=
/namespace/create => brings up a form to create a new object

When the Chained actions are printed out everything looks fine, but when
I goto "/namespace/create" it matches the "/namespace/" view
action.  Needless to say, there isn't an object with the numeric id of
"create."

I would like for Catalyst to try and match the explicit PathPart before
matching the wild card that is .  Any thoughts on best ways to get
around this?
A couple of ways I thought of were:

I could make the view path be "/namespace//view," it seems a little
weird, but would be acceptable if need be.

I could have an action that matches "/namespace/*" and then forward to
the create action if "*" is "create" and to the view action other wise,
but this could limit my ability to further chain from here.

Catalyst just might not match the paths in a way that is conducive to
this, but just thought I'd throw this out there.

Les
  

http://use.perl.org/~LTjake/journal/31738

-=Chris



I use this exact setup, and I assume most do. How is your create
declared?  sub create : Local {} ?

  



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


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


Re: [Catalyst] PathPart help

2007-11-15 Thread Christopher H. Laco
Les Fletcher wrote:
> I have question about setting up PathPart's and Chaining.  I am trying
> to set something that has the following look:
> 
> /namespace/ => This lists out a list of objects
> /namespace/ => displays detail information about the object with the
> numeric id=
> /namespace//edit => brings up a form to edit object with numeric
> id=
> /namespace/create => brings up a form to create a new object
> 
> When the Chained actions are printed out everything looks fine, but when
> I goto "/namespace/create" it matches the "/namespace/" view
> action.  Needless to say, there isn't an object with the numeric id of
> "create."
> 
> I would like for Catalyst to try and match the explicit PathPart before
> matching the wild card that is .  Any thoughts on best ways to get
> around this?
> A couple of ways I thought of were:
> 
> I could make the view path be "/namespace//view," it seems a little
> weird, but would be acceptable if need be.
> 
> I could have an action that matches "/namespace/*" and then forward to
> the create action if "*" is "create" and to the view action other wise,
> but this could limit my ability to further chain from here.
> 
> Catalyst just might not match the paths in a way that is conducive to
> this, but just thought I'd throw this out there.
> 
> Les

http://use.perl.org/~LTjake/journal/31738

-=Chris



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/[EMAIL PROTECTED]/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] PathPart help

2007-11-15 Thread Christopher H. Laco
Ashley Pond V wrote:
> That is really cool and answers something I've wanted to do for a long
> time (let the user define the URI to customize a package). I have a
> question. Using the PathPrefix seems to work as advertised but it does
> not replace the default path.
> 
> So, in a test I just did, MyApp::Controller::Article with
> __PACKAGE__->config( path => 'a' ) gives the expected, new, result at
> path "/a" but also still responds at "/article." Seems like this is not
> DWIW or M. (I'm using the sample sub in the post, not the trunk code).
> 
> The others replace correctly though(?).
> 
> /a == /article
>   but
> /a/id works while /article/id fails as I'd like.
> 
> -Ashley

Someone correct me if I'm wrong, but I don't believe PathPrefix is in a
release yet...only current source, which is probably going to be 5.9.

I still, as of the latest release on CPAN, have to add the PathPrefix
attr parsing sub.

Good old LTjake. That post has save me many hours of crying...over, and
over with chained.

-=Chris



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/[EMAIL PROTECTED]/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] PathPart help

2007-11-15 Thread Ashley Pond V

Now the difference with the path prefix stuff is lost to me.

This fixes the root namespace issue (seems obvious now) and works like
the path prefix is supposed to.

__PACKAGE__->config( namespace => 'a' )

What finer point am I missing? You're right, it's not in the
release yet, just the trunk.

On Nov 15, 2007, at 1:03 PM, Christopher H. Laco wrote:


Ashley Pond V wrote:
That is really cool and answers something I've wanted to do for a  
long

time (let the user define the URI to customize a package). I have a
question. Using the PathPrefix seems to work as advertised but it  
does

not replace the default path.

So, in a test I just did, MyApp::Controller::Article with
__PACKAGE__->config( path => 'a' ) gives the expected, new, result at
path "/a" but also still responds at "/article." Seems like this  
is not
DWIW or M. (I'm using the sample sub in the post, not the trunk  
code).


The others replace correctly though(?).

/a == /article
  but
/a/id works while /article/id fails as I'd like.

-Ashley


Someone correct me if I'm wrong, but I don't believe PathPrefix is  
in a

release yet...only current source, which is probably going to be 5.9.

I still, as of the latest release on CPAN, have to add the PathPrefix
attr parsing sub.

Good old LTjake. That post has save me many hours of crying...over,  
and

over with chained.

-=Chris

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/ 
[EMAIL PROTECTED]/

Dev site: http://dev.catalyst.perl.org/



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


Re: [Catalyst] PathPart help

2007-11-15 Thread Ashley Pond V
That is really cool and answers something I've wanted to do for a  
long time (let the user define the URI to customize a package). I  
have a question. Using the PathPrefix seems to work as advertised but  
it does not replace the default path.


So, in a test I just did, MyApp::Controller::Article with __PACKAGE__- 
>config( path => 'a' ) gives the expected, new, result at path "/a"  
but also still responds at "/article." Seems like this is not DWIW or  
M. (I'm using the sample sub in the post, not the trunk code).


The others replace correctly though(?).

/a == /article
  but
/a/id works while /article/id fails as I'd like.

-Ashley


On Nov 15, 2007, at 12:07 PM, Christopher H. Laco wrote:

http://use.perl.org/~LTjake/journal/31738

-=Chris


I use this exact setup, and I assume most do. How is your create
declared?  sub create : Local {} ?



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


Re: [Catalyst] PathPart help

2007-11-15 Thread Christopher H. Laco
Christopher H. Laco wrote:
> Les Fletcher wrote:
>> I have question about setting up PathPart's and Chaining.  I am trying
>> to set something that has the following look:
>>
>> /namespace/ => This lists out a list of objects
>> /namespace/ => displays detail information about the object with the
>> numeric id=
>> /namespace//edit => brings up a form to edit object with numeric
>> id=
>> /namespace/create => brings up a form to create a new object
>>
>> When the Chained actions are printed out everything looks fine, but when
>> I goto "/namespace/create" it matches the "/namespace/" view
>> action.  Needless to say, there isn't an object with the numeric id of
>> "create."
>>
>> I would like for Catalyst to try and match the explicit PathPart before
>> matching the wild card that is .  Any thoughts on best ways to get
>> around this?
>> A couple of ways I thought of were:
>>
>> I could make the view path be "/namespace//view," it seems a little
>> weird, but would be acceptable if need be.
>>
>> I could have an action that matches "/namespace/*" and then forward to
>> the create action if "*" is "create" and to the view action other wise,
>> but this could limit my ability to further chain from here.
>>
>> Catalyst just might not match the paths in a way that is conducive to
>> this, but just thought I'd throw this out there.
>>
>> Les
> 
> http://use.perl.org/~LTjake/journal/31738
> 
> -=Chris

I use this exact setup, and I assume most do. How is your create
declared?  sub create : Local {} ?



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/[EMAIL PROTECTED]/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] PathPart help

2007-11-15 Thread Les Fletcher
I have question about setting up PathPart's and Chaining.  I am trying 
to set something that has the following look:


/namespace/ => This lists out a list of objects
/namespace/ => displays detail information about the object with the 
numeric id=

/namespace//edit => brings up a form to edit object with numeric id=
/namespace/create => brings up a form to create a new object

When the Chained actions are printed out everything looks fine, but when 
I goto "/namespace/create" it matches the "/namespace/" view 
action.  Needless to say, there isn't an object with the numeric id of 
"create."


I would like for Catalyst to try and match the explicit PathPart before 
matching the wild card that is .  Any thoughts on best ways to get 
around this? 


A couple of ways I thought of were:

I could make the view path be "/namespace//view," it seems a little 
weird, but would be acceptable if need be.


I could have an action that matches "/namespace/*" and then forward to 
the create action if "*" is "create" and to the view action other wise, 
but this could limit my ability to further chain from here.


Catalyst just might not match the paths in a way that is conducive to 
this, but just thought I'd throw this out there.


Les

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


Re: [Catalyst] Re: Ubuntu / Catalyst

2007-11-15 Thread Matt S Trout
On Wed, Nov 14, 2007 at 05:11:48PM +, Richard Jones wrote:
> Matt S Trout wrote:
> >That's because I was bitching about later Ubuntus, not Dead Rat.
> >
> >  
> Dead Rat  ==  CentOS 5?

Anything that came out of Red Hat, basically :)

I'm not a fan.

-- 
  Matt S Trout   Need help with your Catalyst or DBIx::Class project?
   Technical Directorhttp://www.shadowcat.co.uk/catalyst/
 Shadowcat Systems Ltd.  Want a managed development or deployment platform?
http://chainsawblues.vox.com/http://www.shadowcat.co.uk/servers/

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


Re: [Catalyst] Re: Ubuntu / Catalyst

2007-11-15 Thread Christopher H. Laco
Matt S Trout wrote:
> On Wed, Nov 14, 2007 at 05:11:48PM +, Richard Jones wrote:
>> Matt S Trout wrote:
>>> That's because I was bitching about later Ubuntus, not Dead Rat.
>>>
>>>  
>> Dead Rat  ==  CentOS 5?
> 
> Anything that came out of Red Hat, basically :)
> 
> I'm not a fan.
> 

Really? I hadn't noticed. Try to speak out more next time. :-)



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/[EMAIL PROTECTED]/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Re: Ubuntu / Catalyst

2007-11-15 Thread Matt S Trout
On Wed, Nov 14, 2007 at 09:39:38AM -0600, [EMAIL PROTECTED] wrote:
>   While I mostly agree with Matt's take on unix/linux issues -- I will
> give my support to Cent/RH here.  It is true,  they have had some missteps
> with perl in the past.  Those tend get resolved fairly quickly. The perl
> speed issue listed above is fixed in current patches.

Is it fuck.

It's now a 2* hit rather than a 30* hit but the brain-damage is still there,
at least according to Jon Schutz's last benchmark of a couple weeks back.

-- 
  Matt S Trout   Need help with your Catalyst or DBIx::Class project?
   Technical Directorhttp://www.shadowcat.co.uk/catalyst/
 Shadowcat Systems Ltd.  Want a managed development or deployment platform?
http://chainsawblues.vox.com/http://www.shadowcat.co.uk/servers/

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


Re: [Catalyst] Storing DateTime in session causes warning

2007-11-15 Thread J. Shirley
On Nov 15, 2007 6:23 AM, Christopher H. Laco <[EMAIL PROTECTED]> wrote:

> Tobias Kremer wrote:
> > I'm storing a DateTime object in $c->session and I just realized that
> this
> > is causing the following warning on every request:
> >
> > "Use of uninitialized value in subroutine entry at ../../lib/Storable.pm
> > (autosplit into ../../lib/auto/Storable/_freeze.al) line 290."
> >
> > The following reproduces the error for me:
> >
> > $c->session->{ 'mydate' } = DateTime->new( year => 2007 );
> >
> > (for instance in the auto method of the Root controller)
> >
> > Can somebody confirm this? Any ideas on what's going on and how to fix
> it?
> >
> > --Tobias
>
> I have the exact same issue. I'm storing my user/roles object data hash
> in session, and get the same warning all over the place. Annoying as hell.
>
> Indeed, if I swap out the DateTime objects for strings before stuffing
> then in the session, the warnings go away.
>
> So yes, I see it too. :-)
>
> -=Chris
>
>
> ___
> List: Catalyst@lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive:
> http://www.mail-archive.com/[EMAIL PROTECTED]/
> Dev site: http://dev.catalyst.perl.org/
>
>

What version of DateTime::Locale do you guys have?

0.32 had a bug in it that didn't play nice with storable, so make sure you
have the latest.

-J

-- 
J. Shirley :: [EMAIL PROTECTED] :: Killing two stones with one bird...
http://www.toeat.com
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[EMAIL PROTECTED]/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] DBIC v Cache: What are catalyst best practices for caching DBIC results (with relationships included)

2007-11-15 Thread Matt S Trout
On Thu, Nov 15, 2007 at 11:00:51AM +0100, Tobias Kremer wrote:
> Quoting Ashley Pond V <[EMAIL PROTECTED]>:
> 
> > 'Cause I'm outta the loop. That looks quite nice. The doc is a bit terse
> > (though that might really be all there is to it). Can you clear just a
> > part of the cache? It's okay if not but I'd like to be able to clear
> > one document or result_set out when it's updated without messing with
> > others that haven't changed.
> 
> Wow, I didn't know this either. Looks promising! Is it considered
> stable and in production use at Takkle?

Yes, and yes.

> I'd also like to know, if it's possible to invalidate the cache after an
> update or insert with Cursor::Cached?

It's a per-query cache; if you'd care to write code that provides scalable
logic to provide a reverse index and know which queries' caches to clear
after any given statement I'd be happy to incorporate it, but without that
you'd have to clear every query for any table touched, which would pretty
much defy the point of having a cache for any site with significant updates.

-- 
  Matt S Trout   Need help with your Catalyst or DBIx::Class project?
   Technical Directorhttp://www.shadowcat.co.uk/catalyst/
 Shadowcat Systems Ltd.  Want a managed development or deployment platform?
http://chainsawblues.vox.com/http://www.shadowcat.co.uk/servers/

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


Re: [Catalyst] DBIC v Cache: What are catalyst best practices for caching DBIC results (with relationships included)

2007-11-15 Thread Matt S Trout
On Wed, Nov 14, 2007 at 05:02:50PM -0800, Ashley Pond V wrote:
> 'Cause I'm outta the loop. That looks quite nice. The doc is a bit terse
> (though that might really be all there is to it). Can you clear just a
> part of the cache? It's okay if not but I'd like to be able to clear
> one document or result_set out when it's updated without messing with
> others that haven't changed.
> 
> I suppose you might be able to do that by refetching it?

Get resultset object. Then

$rs->cursor->clear_cache; # deletes data from cache

-- 
  Matt S Trout   Need help with your Catalyst or DBIx::Class project?
   Technical Directorhttp://www.shadowcat.co.uk/catalyst/
 Shadowcat Systems Ltd.  Want a managed development or deployment platform?
http://chainsawblues.vox.com/http://www.shadowcat.co.uk/servers/

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


Re: [Catalyst] Storing DateTime in session causes warning

2007-11-15 Thread Christopher H. Laco
Tobias Kremer wrote:
> I'm storing a DateTime object in $c->session and I just realized that this
> is causing the following warning on every request:
> 
> "Use of uninitialized value in subroutine entry at ../../lib/Storable.pm
> (autosplit into ../../lib/auto/Storable/_freeze.al) line 290."
> 
> The following reproduces the error for me:
> 
> $c->session->{ 'mydate' } = DateTime->new( year => 2007 );
> 
> (for instance in the auto method of the Root controller)
> 
> Can somebody confirm this? Any ideas on what's going on and how to fix it?
> 
> --Tobias

I have the exact same issue. I'm storing my user/roles object data hash
in session, and get the same warning all over the place. Annoying as hell.

Indeed, if I swap out the DateTime objects for strings before stuffing
then in the session, the warnings go away.

So yes, I see it too. :-)

-=Chris



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/[EMAIL PROTECTED]/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] Storing DateTime in session causes warning

2007-11-15 Thread Tobias Kremer
I'm storing a DateTime object in $c->session and I just realized that this
is causing the following warning on every request:

"Use of uninitialized value in subroutine entry at ../../lib/Storable.pm
(autosplit into ../../lib/auto/Storable/_freeze.al) line 290."

The following reproduces the error for me:

$c->session->{ 'mydate' } = DateTime->new( year => 2007 );

(for instance in the auto method of the Root controller)

Can somebody confirm this? Any ideas on what's going on and how to fix it?

--Tobias

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


Re: [Catalyst] DBIC v Cache: What are catalyst best practices for caching DBIC results (with relationships included)

2007-11-15 Thread Tobias Kremer
Quoting Ashley Pond V <[EMAIL PROTECTED]>:

> 'Cause I'm outta the loop. That looks quite nice. The doc is a bit terse
> (though that might really be all there is to it). Can you clear just a
> part of the cache? It's okay if not but I'd like to be able to clear
> one document or result_set out when it's updated without messing with
> others that haven't changed.

Wow, I didn't know this either. Looks promising! Is it considered
stable and in production use at Takkle?

I'd also like to know, if it's possible to invalidate the cache after an
update or insert with Cursor::Cached?

--Tobias

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