Re: [Catalyst] get the path to the home

2007-09-28 Thread Chisel Wright
On Fri, Sep 28, 2007 at 03:30:23PM +0300, Octavian Rasnita wrote:
> Hi,
> 
> I have a I18N module in my Catalyst application and I want to get the path 
> to the home directory of the application. Is it possible to get it without 
> hard codding it in that module?
> 
> The module is:
> 
> package MyApp::I18N::ro;

Assuming you can access to $c, I think this is what you want:

  $c->path_to(’’)

It's described in 'perldoc Catalyst' and mentioned in 'perldoc
Catalyst::Plugin::ConfigLoader'

-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

   Any fool can use a computer. Many do.

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


Re: [Catalyst] remove

2007-08-16 Thread Chisel Wright
Alternatively use a method that works.

Send an email to:

 [EMAIL PROTECTED]

with a subject line of:

  unsubscribe
-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

  I'm demented in a good way!

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


Re: [Catalyst] t directory hierarchy

2007-08-15 Thread Chisel Wright
On Wed, Aug 15, 2007 at 11:27:14AM +0100, Ian Docherty wrote:
> Hi
> I have been using Catalyst for some time with a 'flat' test directory, 
> with all test scripts in the same directory.
> 
> The main reason for this is that when I do
> 
> $ make test
> 
> It does not recurse into the sub-directories and only runs test scripts 
> in the 't' directory.
> 
> However I have just found out that when I do
> 
> $ prove --lib lib t/*

I think "make test" is equivalent to "prove -l t/" not "prove -l t/*"

The usual way to make prove recurse is to use -r.

try:

  mkdir -p t/foo/bar/
  cp t/sometest.t t/foo/bar/

I have a feeling that test won't get run

-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

 "My theory is that all of Scottish cuisine is based on a dare."
  - Mike Myers

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


Re: [Catalyst] Multi Mod_Perl apps

2007-08-08 Thread Chisel Wright
On Wed, Aug 08, 2007 at 06:14:54AM -0700, Will Smith wrote:
>My question is the PerlSwitches, will it get any error with that?

Dunno - do you get errors when *you* try it?

-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

  I may be a pretty sad person, but I don't make jokes in base 13.

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


Re: [Catalyst] How to execute controller at startup

2007-08-06 Thread Chisel Wright
On Mon, Aug 06, 2007 at 08:09:32PM +0530, Aditya Verma wrote:
>I need all my controllers to execute at startup and register there method
>URLs.
>I am not getting how to execute controller at startup.

I'm confused ... all of my actions are automagically detected.

I don't understand why you'd want to *execute* *ALL* of your controller
methods - is that really what you intended?

 cut here 
[debug] Loaded Private actions:
.--+-+--.
| Private  | Class   | Method   |
+--+-+--+
| /default | Parley::Controller::... | default  |
| /end | Parley::Controller::... | end  |
| /index   | Parley::Controller::... | index|
| /auto| Parley::Controller::... | auto |
| /render  | Parley::Controller::... | render   |
| /my/preferences  | Parley::Controller::... | preferences  |
| /post/view   | Parley::Controller::... | view |

*snip*
 cut here 

-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

  I may be a pretty sad person, but I don't make jokes in base 13.

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


Re: [Catalyst] Re: Trimming and Quoting Oh My!

2007-07-25 Thread Chisel Wright
On Wed, Jul 25, 2007 at 04:33:25PM +0200, Daniel McBrearty wrote:
> "over" marketing? "through" marketing ... "under" ...

"runawayscreamingfrom" - it's a new word created especially for the
occasion.

-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

  One in a million chances happen nine times out of ten.

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


Re: [Catalyst] Re: Trimming and Quoting Oh My!

2007-07-25 Thread Chisel Wright
On Wed, Jul 25, 2007 at 04:10:42PM +0200, Daniel McBrearty wrote:
> this thread reminds me of why I sometimes wish I'd gone into marketing.

*into* marketing? having worked in a marketing company I can say with
confidence that *into* is definitely the wrong direction to be moving.
;-)

-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

  The following sentence is true.
  The previous sentence is false.

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


Re: [Catalyst] Trimming and Quoting Oh My!

2007-07-25 Thread Chisel Wright
On Tue, Jul 24, 2007 at 11:58:53PM +0100, Matt S Trout wrote:
> 3. People with plain text sigs with hard returns to keep the damn things
> to 78 chars

*blush*

Fixed, for its next random insertion *fnar*.

-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

  My computer's so fast it finishes an infinite loop in 5 minutes.

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


Re: [Catalyst] Re: Trimming and Quoting Oh My!

2007-07-25 Thread Chisel Wright
On Wed, Jul 25, 2007 at 08:57:26AM -0400, Christopher H. Laco wrote:
> The UsePerl post wasn't mine, but I feel akin to it. If people are
> participating in helping people, or asking for help via email, don't
> bitch about their email format. The alternative is that no one wants to
> participate on the list because rather than getting help, they're
> accosted by the email format police.

I wasn't trying to get all "email reply nazi" on everyone's ass. It just
seems to me that the list has become increasingly difficult to
read/parse over the last few weeks.

I was just hoping that people *might* want to consider trimming
unnecessary [and often] chunks of quoted material, just to "keep the
flow".

Also, if I'm looking at a post and it looks like the one I just read,
but with a different author, I'm not going to take the time to diff the
two posts on the off chance that there's something in there that might
be useful, or even rarer, that I can offer assistance with.

I know I'm not a prominent poster on this list, but from time to time I
do have answers and opinions that may actually be relevant.

Skipping over unreadable postings drastically reduces the chances of me
spotting that one post in six months that I can help with.

I'll just go back to skim-reading and lurking.

Chisel
-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

  One in a million chances happen nine times out of ten.

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


[Catalyst] Trimming and Quoting Oh My!

2007-07-24 Thread Chisel Wright
Just a polite request. Would it be possible for:

 1. people to trim quotes? It'd be really nice to not have to wade
 through a couple of hundred lines of the initial post in a thread being
 re-quoted every time someone replies.

 2. people to quote properly? Half the time these days I have no clue
 who's added what to a post - usually because (I presume) they're
 posting HTML/multipart messages and using colouring nor ">" markers to
 distinguish quoted and new content.

Sorry if this spouts a MUA and/or top-posting flamewar. It's not my
intention; I'd just like to be able to read the list properly (again).

Cheers,

Chisel
-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

  The first rule of ultra-violet pen club is no-one discusses ultra-violet pen 
club.
  The second rule is always replace the cap.

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


Re: [Catalyst] Please remove me from the mailing list.

2007-07-18 Thread Chisel Wright
On Wed, Jul 18, 2007 at 10:20:05AM -0400, Michael Caudy wrote:
>Please remove me from the mailing list.

Please follow the Listinfo link added to the end of each mail to this
list.
Scroll down.
Insert your email address.


>Thanks.

Pleasure.

> Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst

There it is!

-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

  My computer's so fast it finishes an infinite loop in 5 minutes.

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


Use block if, not postfix if [was: Re: [Catalyst] TT2 + CP::Authentication + DBIC gotcha]

2007-07-13 Thread Chisel Wright
On Fri, Jul 13, 2007 at 04:33:59PM +0100, Matt Lawrence wrote:
> What's wrong with that? I find it a lot more readable than
> 
> my $vote;
> if ($bar) {
>$vote = $foo;
> }

Check chapter 6 in PBP for the reasoning I'd parrot here if I could be
bothered to type it all myself.


-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

  It's just a motivational meeting. I don't care if I miss it.

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


Re: [Catalyst] Render Templates...

2007-07-11 Thread Chisel Wright
On Wed, Jul 11, 2007 at 11:17:22AM -0400, Richard Martini wrote:
>Hi,
> 
>I'm new in Catalyst and I'm generating reports in PDF using HTML::HTMLDoc
>but I have a problem I don't know how to get the render of my template in
>a variable to export it into a document.
> 
>I am using Perl v5.8.8, Catalyst 5.7, Apache2.2.3 and mod_perl2.0.2.

http://www.catalystframework.org/calendar/2006/12 ?


-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

  All complaints must be submitted in writing
  on the back of a ten pound note.

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


Re: [Catalyst] displaying email addresses

2007-06-28 Thread Chisel Wright
On Thu, Jun 28, 2007 at 06:31:28PM +0300, Octavian Rasnita wrote:
> Those harversters should have a Javascript interpreter that will compile 
> the js code and extract the results, and I think most of them don't have 
> such a thing.
> 
> I have never used a JS interpreter in perl, but I want to try a few modules 
> that could run JS code, and I hope I will find a way of making the code as 
> hard to read as possible.

Maybe this will be of some interest:

  http://www.bronze-age.com/nospam/

-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

  IRC is just multiplayer notepad.

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


Re: [Catalyst] displaying email addresses

2007-06-28 Thread Chisel Wright
On Thu, Jun 28, 2007 at 02:22:24PM +0300, Octavian Rasnita wrote:
> Do you know if there are any Catalyst plugins, or TT filters, or perl 
> modules that can find all the email addresses in a text and convert them 
> into a Javascript code that prints that email address (possibly as a link)?

Why do you need a plugin for this? Isn't it something you'd write a
simple(ish) function for that does some kind of search&replace?

Email::Find maybe?
-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

  One in a million chances happen nine times out of ten.

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


Re: [Catalyst] setup() called twice

2007-06-19 Thread Chisel Wright
On Tue, Jun 19, 2007 at 05:49:45PM +0100, Matt S Trout wrote:
> Read half a dozen plugins' setup methods and come back when you have a clue.

Ouch! No need to be like that was there?

-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

  I wrote a todo list; Now I can procrastinate more efficiently!

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


Re: [Catalyst] Requirement for Makfile.PL or Build.PL in "home"?

2007-05-29 Thread Chisel Wright
On Tue, May 29, 2007 at 08:14:17AM -0700, Jeff Chimene wrote:
> As badly as things have gone with this technique as well as the
> responses I've received from you and Jonathan, I will avoid asking the
> list for further advice.

Shame, this list is an excellent resource. I reckon in the long run
you'll make things more difficult for yourself. Still, TMTOWTDI


-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

  I even make myself laugh sometimes...

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


Re: [Catalyst] Link to file

2007-05-24 Thread Chisel Wright
On Thu, May 24, 2007 at 09:29:40AM -0700, Will Smith wrote:
>thank you for all of your help.
>Yes, I just want to link to a file on local machine. And yes, I added the
>file:// to the path, but it links to nowhere. When cursor over, it shows
>file:///var. just like any other links on a html page outside Cat, but
>it links to nothing. Just wonder if you ever really put a link like that
>on your app.

I have no idea where you're storing the files on your system, but that
looks like the format I'd expect for a file: url, e.g.
file:///etc/resolv.conf works just fine.

Where is the file? (with full path)? You are using a browser on the same
machine that you're running catalyst on aren't you?

-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

  For this and the answers to many other questions don't ask me.

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


Re: [Catalyst] Link to file

2007-05-24 Thread Chisel Wright
On Thu, May 24, 2007 at 08:43:52AM -0700, Will Smith wrote:
>the error is : File Not Found.
>Yes, I have apache, and also tried on dev machine at localhost. Problem is
>when adding the file path to template, like: listen, and myvar = '/var/www/html/myfolder/myfile.wav';
>when move the cursor over  "listen" the link is :
>http://localhost:3000/var/www/html/myfolder/myfile.wav  or
>http://www.mydomain.com/var/www/html/myfolder/myfile.wav
> 
>Obviously, this is the wrong path to the file. How can I drop the
>http://... before the real path?

I have a nasty feeling you're trying to do something a very bizarre and
bad way, but on the basis that you seem to want to link to a file on
your local file system:

how about either using listen or
having file:// already in myvar.

However, the fact that file:// (or dropping http://) seems to be in your
solution anywhere at all is really setting alarm bells ringing.

-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

  Screenie or it didn't happen.

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


Re: [Catalyst] Sending email from Catalyst and scripts

2007-05-23 Thread Chisel Wright
On Wed, May 23, 2007 at 07:41:21AM +0100, Mark Zealey wrote:
> Why can you not do something like $c->stash->{emails_to_send} and then just 
> fire them off in the end() action after the page has been returned to the 
> remote browser?
> 

Because I don't want to spend any longer between *click* and "page
loaded" than I have to.
I feel happier having a queue of emails that I can process at my
leisure.

I don't have any benchmarking or test cases to show that my way is
better, or faster - but I'm not claiming this. It's Just The Way I Do It
and it makes me feel more comfortable with the process.
-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

  Sorry isn't an excuse when you do something stupid on purpose.

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


Re: [Catalyst] Sending email from Catalyst and scripts

2007-05-22 Thread Chisel Wright
On Tue, May 22, 2007 at 11:10:58AM -0700, Evaldas Imbrasas wrote:
> I'm looking for best practices for sending email from the catalyst app
> that would also work with command-line scripts (cronjobs, one-time
> scripts, etc.).

Personally I use a database table as a crude email queue. I should
probably use an MTA, but I don't.

The table is pretty simple; id, queued_time, recipient, cc, bcc, sender,
subject, text_content, html_content.
Obviously you can move the recipient, etc out into join tables, etc if
you want, but this suits my needs.

Then my application can dump emails there, in fact anything can if it
wishes.
The application uses the ->render() method on a view that doesn't
automatically include header.tt and footer.tt from the application
itself. (MyApp::View::Plain vs MyApp::View::TT - both use TT, they're
just configured differently)

While I'm developing, no emails get sent, and I poke the db to double
check things. From time to time I'll run a simple daemon that picks up
emails, builds and delivers them (using MIME::Lite).


I don't like sending emails directly from controller actions. I'm
worried about things taking a long time, no idea what's gone through the
system, and so on.


-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

  If you were MEANT to understand it, we wouldn't have called it 'code'

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


Re: [Catalyst] Using a custom TT filter

2007-05-22 Thread Chisel Wright
On Tue, May 22, 2007 at 01:20:46PM +0300, Octavian Rasnita wrote:
> Hi,
> 
> I am trying to use a custom TT filter in a Catalyst app.
> 
> In MyApp.pm I use:
> 
> 'View::TT' => {
> PLUGIN_BASE => __PACKAGE__->path_to('lib'),
> },

Not strictly a Catalyst question, but my guess is you're using
PLUGIN_BASE incorrectly.

According to 'perldoc Template::Plugin' (which of course you've already
read):


   Use the PLUGIN_BASE option to specify the namespace that you use.  e.g.

   use Template;
   my $template = Template->new({
   PLUGIN_BASE => ’MyOrg::Template::Plugin’,
   });

You're not specifying a namespace, you're giving a path ...
-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

  My computer's so fast it finishes an infinite loop in 5 minutes.

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


Re: [Catalyst] Setting time zone and locale on dates.

2007-05-22 Thread Chisel Wright
On Tue, May 22, 2007 at 10:20:26AM +0100, Pedro Melo wrote:
> I always do my model datetime stuff in UTC.

After many years of painful date-work thanks to decisions made by
others, this is how I prefer to work.
Store everything in UTC (with time zome, just to be clear).

After that, formatting and TZ tweaking is just "eye candy" in the
template

-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

  Atheism is a religion, provided you also accept that
  NOT collecting stamps is a hobby.

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


Re: [Catalyst] Setting time zone and locale on dates.

2007-05-22 Thread Chisel Wright
On Tue, May 22, 2007 at 01:55:23AM +0100, Matt S Trout wrote:
> DBIx::Class::InflateColumn::DateTime will do this part for you these days.

I'd noticed that floating around but never found the tuits to
investigate.

Maybe I should install the tinker on my laptop and investigate on my
next commute.

C.
-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

  For this and the answers to many other questions don't ask me.

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


Re: [Catalyst] Setting time zone and locale on dates.

2007-05-21 Thread Chisel Wright
On Mon, May 21, 2007 at 01:54:54PM -0700, Bill Moseley wrote:
> What do you do?

I inflate all my dates to DateTime objects:

  foreach my $datecol (qw/created/) {
__PACKAGE__->inflate_column($datecol, {
  inflate => sub { DateTime::Format::Pg->parse_datetime(shift); },
  deflate => sub { DateTime::Format::Pg->format_datetime(shift); },
});
  }

Then to display dates, I pass them through my somewhat scruffy looking
nicedate() TT macro:

http://svn.berlios.de/svnroot/repos/parley/trunk/root/base/shared/useful_tt_stuff

There might be nicer ways, but the overall method seems to be working
really well for me so far.

I'm not sure if/how locale would tie into this though.

Chisel
-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

  SELECT message FROM signatures ORDER BY RANDOM() LIMIT 1;

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


Re: [Catalyst] Encrypt /Decrypt URI

2007-05-18 Thread Chisel Wright
On Fri, May 18, 2007 at 03:35:21PM +0530, Harshal Shah wrote:
>Hi Chisel,
> 
>just didn't want user to see the  url details.to prevent unauthorized
>access...
> 
>I know authorization plugin does the same ..but i had too many rules and
>conditions..so I thought it would be lot simpler if users can't figure out
>the urls ..

Security through obscurity isn't security at all.

Someone will find out, work out, or just plain guess the URLs you don't
want them to find.
So you'd want auth-access anyway ... just to $c->res->content(q{ner ner
ner!}) them.


-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

  For this and the answers to many other questions don't ask me.

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


Re: [Catalyst] Re: Catalyst actions

2007-05-18 Thread Chisel Wright
On Thu, May 17, 2007 at 10:29:26PM +0100, Matt S Trout wrote:
> On Thu, May 17, 2007 at 10:59:09PM +0400, Oleg Pronin wrote:
> > Use
> > 
> > sub index : Private {
> >#search code
> > }
> 
> Please don't, index is a nasty hack.
> 
> sub base :Path :Args(0)

Maybe Catalyst could emit something via ->log when there's a far better
way to do something?

Maybe even a -SuggestImprovement flag or something. I dunno ... it just
seems that I take my eye of the ball for a second and the way I learned
to do $something is old hat, frowned on, or wrong.

Chisel
-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

  The following sentence is true.
  The previous sentence is false.

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


Re: [Catalyst] Encrypt /Decrypt URI

2007-05-18 Thread Chisel Wright
On Fri, May 18, 2007 at 08:29:18AM +0530, Harshal Shah wrote:
> just tryin to hide URLs from users ..

If you don't want users to see URLs, why are you writing a web-app?
-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

  Brownian motion: the motion of money from individuals'
  pockets to the Treasury coffers.

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


Re: [Catalyst] User account registration login

2007-05-13 Thread Chisel Wright
On Sat, May 12, 2007 at 10:23:41AM -0500, Tom Printy wrote:
> I was wondering if there is a user registration/account creation/login
> module for catalyst.  While I understand that all login systems are
> different I was hoping that there was one that I could extend to meet my
> needs instead of rolling my own from scratch. Furthermore is there a
> directory of open Catalyst projectes out there other than the Catalyst
> wiki?

It may not suit your needs, but by all means have a look at what I've
knocked together for my app. It's basically a sign-up form with and
emailed activation link.

The project's here: http://developer.berlios.de/projects/parley

I can't actually browse the SVN repo through there right now, but I
think all the relevant stuff is in Controller::User::SignUp

Chisel
-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

  print $signatures[ rand(@signatures) ];

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


Re: [Catalyst] need nntp server

2007-04-25 Thread Chisel Wright
On Wed, Apr 25, 2007 at 05:21:25PM -0700, 万朝伟 wrote:
> I hate mail list,is there have a nntp server for Catalyst?

Not that I'm aware of. Set up your own nntp server and use
Email::Send::NNTP

-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

  The first rule of ultra-violet pen club is no-one discusses ultra-violet pen 
club.
  The second rule is always replace the cap.

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


Re: [Catalyst] Re: oe1.orf.at now running on Catalyst

2007-04-20 Thread Chisel Wright
On Fri, Apr 20, 2007 at 07:44:30AM -0700, J. Shirley wrote:
> We have some MojoMojo templates (thank jrockway), and now we just need
> time to work on it.  Unfortunately I think this is one of those things
> not very many people find all that interesting to work on so it easily
> slips through the cracks.

What's involved/required to make it happen?


-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

  For this and the answers to many other questions don't ask me.

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


Re: [Catalyst] MySQL server has gone away

2007-04-19 Thread Chisel Wright
On Thu, Apr 19, 2007 at 01:54:52PM +0100, Adeola Awoyemi wrote:
> Hi all,
> 
> I have problem that when I run my app via fastcgi I get an error  
> where one of my models can't connect to the database with the message  
> "MySQL server has gone away". When I start it using 'script/ 
> myapp_server.pl' it works fine.
> 
> Has anyone come across this before? Any hints to fixing this would be  
> greatly appreciated.

I'm not sure if it's the same problem I had a very long time ago, but
you could try playing with the "mysql_auto_reconnect" option (perldoc
DBD::mysql)


-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

  Pedantry is a hugely underrated attribute.

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


Re: [Catalyst] [RFC] ditch svn

2007-04-18 Thread Chisel Wright
On Wed, Apr 18, 2007 at 01:21:07AM -0500, Jonathan Rockway wrote:
> I think it's pretty clear that Subversion is a failure for our project.  We 

It's not clear to me - where's the memo? I don't recall reading anything
about the failing of svn/svk on this list - can you either elaborate or
point me at a thread I missed?

Chisel
-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

  All complaints must be submitted in writing
  on the back of a ten pound note.

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


Re: [Catalyst] HOWTO: extend the Authentication tutorial example and redirect to original URI

2007-03-29 Thread Chisel Wright
On Thu, Mar 29, 2007 at 09:40:56AM -0700, Jeff Chimene wrote:
> it looks like is_logged_in() is a routine you wrote?

Whoops, yes, nothing special, just a convenience:

  sub is_logged_in {
my ($c) = @_;

if ($c->user) {
return 1;
}

return 0;
  }

I think I did that to leave expansion room for other checks/evil in the
future
-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

  AFK, tornado...

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


Re: [Catalyst] HOWTO: extend the Authentication tutorial example and redirect to original URI

2007-03-29 Thread Chisel Wright
On Thu, Mar 29, 2007 at 09:13:31AM -0700, Jeff Chimene wrote:
> As a side question, why does this particular technique use redirect()?
> As opposed to, e.g. detach()?

Because Parley has kinda evolved over [a long period of] time, and I
expect there wasn't a detach() method when I wrote that method. :)

As an example of how useless I am at making time for it, I've only just
got back onto it after a 6-month break.

Chisel
-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

  Brownian motion: the motion of money from individuals'
  pockets to the Treasury coffers.

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


Re: [Catalyst] HOWTO: extend the Authentication tutorial example and redirect to original URI

2007-03-29 Thread Chisel Wright
On Thu, Mar 29, 2007 at 02:27:14AM -0700, Jeff Chimene wrote:
> Hi,
> 
> I was wondering if anyone has extended the Authentication tutorial
> example to handle the "redirect to original URI" concept requested
> in this thread: http://www.gossamer-threads.com/lists/catalyst/users/11676
> 
> Does that suggested answer work with the implementation in
> Catalyst::Manual::Tutorial::Authentication? It looks like one would
> update the "end" method in the login controller to implement this technique?

I just have:

 sub login_if_required {
my ($c, $message) = @_;

if( not $c->is_logged_in($c) ) {
# make sure we return here after a successful login
$c->session->{after_login} = $c->request->uri();
# set an informative message to display on the login screen
if (defined $message) {
$c->session->{login_message} = $message;
}
# send the user to the login screen
$c->response->redirect( $c->uri_for('/user/login') );
return;
}
 }

in MyApp.pm and

# if we've stored somewhere to go after we log-in, got there now
if ( $c->session->{after_login} ) {
$c->response->redirect( delete $c->session->{after_login} );
}

after a successful login.

It's worked for me so far ... 
-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

  IRC is just multiplayer notepad.

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


Re: [Catalyst] Hair-pulling over YAML config

2007-01-31 Thread Chisel Wright
On Tue, Jan 30, 2007 at 12:11:22PM -0600, Jonathan Rockway wrote:
> > To be read from the unparsable/invalild config file? ;-)
> 
> If the config file was parsed OK there's no need to report errors.
> Because there weren't any.


/me heads off to drop a cat with a buttered slice of toast tied to its
back ...

-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

  Always move fast - you never know who's catching up!

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


Re: [Catalyst] Hair-pulling over YAML config

2007-01-30 Thread Chisel Wright
On Tue, Jan 30, 2007 at 09:58:00AM -, Carl Vincent wrote:
> That's exactly what we need - outputting warnings at on of the
> ConfigLoader levels loses the content of the error message. Could
> always add a "Keep Quiet" option...

To be read from the unparsable/invalild config file? ;-)

-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

  This is not an automated signature.
  I type this in to the bottom of every message.

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


Re: Re: [Catalyst] creating binaries

2007-01-17 Thread Chisel Wright
On Wed, Jan 17, 2007 at 12:53:08PM +0200, Octavian Rasnita wrote:
> 2. I am not selling the program directly to the customers, but to someone 
> that asks for some features, including hiding the source.

If "hiding the source" was a requirement, why did you use perl?

-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

  One in a million chances happen nine times out of ten.

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


Re: [Catalyst] creating binaries

2007-01-16 Thread Chisel Wright
On Tue, Jan 16, 2007 at 05:12:05PM +0200, Octavian Rasnita wrote:
> Is it possible to do what I want, using perlapp? If not, is it possible 
> with PAR?

Is this any help?

http://www.catalystframework.org/calendar/2005/6


-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

  One in a million chances happen nine times out of ten.

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


Re: [Catalyst] info basic stash problem...maybe i am too tired this sunday

2007-01-14 Thread Chisel Wright
On Sun, Jan 14, 2007 at 07:30:06PM +0100, Igor Longagnani wrote:
> $chiavi= {
>   'ka-111-234-586' => '0',
>   'ka-90-85-349' => '0',
>   'ka-5-21-629' => '0',
>   'ka-1-406-194' => '0',
>   'ka-111-194-479' => '1',
>   'ka-1-451-540' => '0',
>   'ka-1-254-610' => '0',
>   'ka-1-216-571' => '0',
>   ... more data...
> };

This is a hashref, not a list ...

> 
> [ FOREACH ... %]

Doesn't FOREACH iterate over a list?

> I know it is something silly ... but still makes me doubt about my
> comprehension of the stash

I think it's a TT problem rather than a stash problem.

You might want to investigate the keys method in
Template::Manual::VMethods:

  [% FOREACH key = allegati.keys %]
  Key: [% key %]
  Value: [% allegati.$key %]
  [% END %]

works in a quick local test, for example.

Chisel
-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

  This is not an automated signature.
  I type this in to the bottom of every message.

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


Re: [Catalyst] Preferred Ajax framework

2007-01-11 Thread Chisel Wright
On Thu, Jan 11, 2007 at 11:53:50AM +, Toby Corkindale wrote:
> Downsides: Can get quite slow to load pages.

Yeah, I seem to have been caught out by that. I really like dojo, and
I've not seen any problems with it ... until some changes were rolled
out to a staging server.
Now the page(s) takes ages to load.

I didn't think that the dojo loading block would be a hit every time.
Apparently there's a slowdown with just the following:

  
dojo.require("dojo.widget.Dialog");
  

It only seems to happen with one page, so it might be dojo and existing
jscript not playing well together - who knows?
-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

  print $signatures[ rand(@signatures) ];

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


Re: [Catalyst] How safe are database transactions?

2007-01-04 Thread Chisel Wright
On Thu, Jan 04, 2007 at 11:11:10AM +, Ash Berlin wrote:
> $c->model('MyAppDB')->txn_do(sub {
>   # Do some insertions here
> });

Yes, this is pretty much how I do it too, e.g.:

  sub _add_new_reply {
my ($self, $c) = @_;
my ($new_reply);

# some checks

# otherwise, the form data is ok ...
else {
# try to add the reply to the thread
eval {
$new_reply = $c->model('ParleyDB')->schema->txn_do(
sub { return $self->_txn_add_new_reply($c) }
);
};
# deal with any transaction errors
if ($@) {   # Transaction failed
die "something terrible has happened!"  #
if ($@ =~ /Rollback failed/);   # Rollback failed

$c->stash->{error}{message} =
qq{Database transaction failed: [EMAIL PROTECTED];
$c->log->error( $@ );
return;
}
}
  }
[source: http://xrl.us/t4w3]

and then all the db manipulation goes into "sub _txn_add_new_reply{...}"

I think this is pretty much how the docs recommend to do it. I've not
yet thought of a cleaner way to do this.

Chiz
-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

  Q: What's tiny and yellow and very, very, dangerous?
  A: A canary with the super-user password.

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


Re: [Catalyst] creating a model

2007-01-02 Thread Chisel Wright
On Tue, Jan 02, 2007 at 01:37:35PM -0500, [EMAIL PROTECTED] wrote:
>Not at all.  It wasn't me, it was him

Just after I sent the message I went "oh, . that's not the same
poster".

Time for me to step away from the keyboard for a while I think.

-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

  I may be a pretty sad person, but I don't make jokes in base 13.

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


Re: [Catalyst] creating a model

2007-01-02 Thread Chisel Wright
On Tue, Jan 02, 2007 at 01:10:50PM -0500, [EMAIL PROTECTED] wrote:
>The errors were all about not being able to serialize code refs.

Sorry, I think I misread you previous message, and thought you'd
overcome the Tie::Refhash problem, and you were getting new/different
errors.

My bad.

Chisel
-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

  AFK, tornado...

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


Re: [Catalyst] 404 Not Found

2007-01-02 Thread Chisel Wright
On Tue, Jan 02, 2007 at 09:45:51AM -0800, Michael Reece wrote:
> will things break if i delete the Makefile.PL and define a home in  
> the config?

I honestly don't know - why not rename Makefile.PL, define a home in the
config and see what transpires?

-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

  I may be a pretty sad person, but I don't make jokes in base 13.

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


Re: [Catalyst] creating a model

2007-01-02 Thread Chisel Wright
On Tue, Jan 02, 2007 at 07:42:41PM +0200, Octavian Rasnita wrote:
> It gave errors when using $c->user in a controller or a template. When not 
> using $c->user, the program worked well.

We're making progress. Now about these errors - what do they actually
say?

-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

  Pedantry is a hugely underrated attribute.

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


Re: [Catalyst] 404 Not Found

2007-01-02 Thread Chisel Wright
On Tue, Jan 02, 2007 at 09:18:54AM -0800, Michael Reece wrote:
> >we do our best to let you organise stuff how -you- want to rather  
> >than how we think you're going to want to.
> 
> with that in mind, can something be done about the Makefile.PL  
> location requirement? ;)

Since you haven't said what [you think] is wrong with it, probably not.

Also the post you replied to said "let you organise stuff" ... if it's
somewhere you don't want it - move it.

Chisel
-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

  The ballerina broke the toilet.

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


Re: [Catalyst] flash

2006-12-31 Thread Chisel Wright
On Sun, Dec 31, 2006 at 07:05:30PM +0200, Octavian Rasnita wrote:
> But can you tell me why $c->flash is not working? Should I add a certain 
> plug in for making it work or need making some other settings?

Poking around, there's a small example in
Catalyst::Manual::Tutorial::Authentication:

  $c->flash->{status_msg} = "Book deleted";

and in the template:

  [% Catalyst.flash.status_msg %]


I *think* you can get away without "Catalyst." (or use "c." instead) but
you're almost definitely missing the leading "flash." in your TT markup.

-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

  This is not an automated signature.
  I type this in to the bottom of every message.

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


Re: [Catalyst] DBIx::Class/TT Pager Question

2006-12-29 Thread Chisel Wright
On Fri, Dec 29, 2006 at 08:35:34AM -0800, Dennis Daupert wrote:
>$c->stash->{photos} = [$c->model('CatapultDB::Photos')->search(
...
>)];
> 
>$c->stash->{pager} => $c->stash->{photos}->pager(); # ???

I think you need to lose the square brackets, and you will probably find
you then have a DBIx::Class::ResultSet, which does have the pager()
method.

I can't remember what [$c->model(...)->search(...)] returns but I don't
think you get a ResultSet object.

Chisel
-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

  This is not an automated signature.
  I type this in to the bottom of every message.

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


Re: [Catalyst] DBIx::Class/TT Pager Question

2006-12-29 Thread Chisel Wright
On Fri, Dec 29, 2006 at 08:35:34AM -0800, Dennis Daupert wrote:
>$c->stash->{pager} => $c->stash->{photos}->pager(); # ???

Probably not the root of the problem, but shouldn't this be an
assignment rather than a fat-comma?

Chisel
-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

  SELECT message FROM signatures ORDER BY RANDOM() LIMIT 1;

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


Re: [Catalyst] Various login problems

2006-12-27 Thread Chisel Wright
On Wed, Dec 27, 2006 at 10:35:27AM -0500, Jesse Sheidlower wrote:
> Any suggestions what might be causing this, or where I should
> start to try to figure it out? Keep in mind that I cannot seem
> to force this to happen, so when it's OK, as it is now, I can't
> get it started.

This sounds a bit like the old "tell mysql not to be so annoying" flag -
try setting the "mysql_auto_reconnect" option:

 http://search.cpan.org/dist/DBD-mysql/lib/DBD/mysql.pm#mysql_auto_reconnect

I think you can pass/set it in the DSN string.

-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

  The following sentence is true.
  The previous sentence is false.

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


Re: [Catalyst] How to decline file from extension

2006-12-21 Thread Chisel Wright
On Thu, Dec 21, 2006 at 06:58:28PM +0100, Jean-Michel Caricand wrote:
> Now, when I ask for the URL http://localhost/my_component.mas
> Apache sends an error "NOT FOUND".
> 
> I just want to simulate this behavior in Catalyst without Apache.

What's wrong with changing 403 to 404 in my previous suggestion?

I added

  $c->response->body( 'Not Found' );

to the sub and it seemed to to the right thing:

  $ curl -i http://zombie:3000/my_component.mas
  HTTP/1.0 404 Not Found
  Connection: close
  Date: Thu, 21 Dec 2006 22:26:46 GMT
  Content-Length: 9
  Content-Type: text/html; charset=utf-8
  Status: 404
  X-Catalyst: 5.7006

-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

  The following sentence is true.
  The previous sentence is false.

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


Re: [Catalyst] How to decline file from extension

2006-12-21 Thread Chisel Wright
On Thu, Dec 21, 2006 at 10:24:20AM -0600, Jonathan Rockway wrote:
> I read this and assumed he wanted to know how to prevent Static::Simple
> from serving something.  That case is well-documented, so I suggest that
> he take a look at the Static::Simple documentation.

Just goes to show what a badly written question leads to ...

-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

  What do we want? Less premature ejaculation!
  When do we want it? ... aaw heck

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


Re: [Catalyst] How to decline file from extension

2006-12-21 Thread Chisel Wright
On Thu, Dec 21, 2006 at 01:32:45PM +0100, Jean-Michel Caricand wrote:
> Hi alls,
> 
> I want my Catalyst application refuse to serve file with .mas
> extension. How to do this?

I'm not going to ask why, and the following is untested but what about
something along the lines of:

sub NoDotMas :Regex('\.mas$') {
  my ($self, $c) = @_;
  $c->response->status('403'); # or whatever
}
  

-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

  print $signatures[ rand(@signatures) ];

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


Re: [Catalyst] DateTime Timezone

2006-12-15 Thread Chisel Wright
On Fri, Dec 15, 2006 at 10:34:35AM +0100, Tobias Kremer wrote:
> My application stores all dates in a MySQL database in the UTC timezone.
> Because I'm doing further calculations with these dates after retrieving them
> via DBIx::Class I don't want them to get auto-inflated into the timezone
> of the current user. The DateTime POD recommends doing date calculations only
> with dates of the same timezone and having everything in UTC should make
> things work like they're supposed to work (I hope).
> 
> I think the DateTime objects should only be converted for displaying purposes
> (i.e. when they're going to be displayed in a TT template). Is that correct?
> If so, what's the best way (and where's the best place) to achieve this
> conversion?

I tend to use the following in my schema classes to deal with timestamps
in my app(s):


  package MyApp::Schema::TableName;
  use DateTime::Format::Pg;

  # ...

  foreach my $datecol (qw/created last_modified/) {
__PACKAGE__->inflate_column($datecol, {
  inflate => sub { DateTime::Format::Pg->parse_datetime(shift); },
  deflate => sub { DateTime::Format::Pg->format_datetime(shift); },
});
  }


I'm sure it's not all that different for MySql;
http://search.cpan.org/~drolsky/DateTime-Format-MySQL/

Chisel
-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

  This is not an automated signature.
  I type this in to the bottom of every message.

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


Re: [Catalyst] Re: Catalyst Digest, Vol 21, Issue 27

2006-11-14 Thread Chisel Wright
On Tue, Nov 14, 2006 at 07:03:24AM -0500, Jarrell Dunson wrote:
> Out of the Office reply: I'll be out of the office until Tuesday, Nov
> 14th.  If an emergency, please contact the helpdesk, x2200
>   Thanks, 
>  Jarrell

Three of these for different digests ... is this someone who's vacation
message only works when their mail client is running?

I guess we should be grateful they get this list in digest format.

Chisel
-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

  This is not an automated signature.
  I type this in to the bottom of every message.

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


Re: [Catalyst] log infor using FastCGI enigine in Apache

2006-11-14 Thread Chisel Wright
On Tue, Nov 14, 2006 at 01:50:39PM +1030, Jon wrote:
> I found Catalyst::Log::Log4perl a good alternative.  Unfortunately not
> compatible with Catalyst::Plugin::Dumper though.

Yeah, dig back through the archives and you'll find mst's fair and true
comment on my apalling implementation of CP::Dumper.

It was a quick lazy hack, and never quite made it past there.

Rewrites/patches welcome :)

Chisel
-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

  This is not an automated signature.
  I type this in to the bottom of every message.

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


Re: [Catalyst] Catalyst::View::TT

2006-11-13 Thread Chisel Wright
On Mon, Nov 13, 2006 at 08:46:27PM +1000, Ivan Wills wrote:
> Any one know how to remove those blank lines?

I think you are talking about the "[%- ... %] syntax; search for %- in
Template::Manual::Syntax

Chisel
-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

  What do we want? Less premature ejaculation!
  When do we want it? ... aaw heck :(

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


Re: [Catalyst] HTML::FillInForm (1.06) - a bug?

2006-09-27 Thread Chisel Wright
On Wed, Sep 27, 2006 at 11:33:01PM +0900, Tatsuhiko Miyagawa wrote:
> Yeah, this looks like a bug and here's a patch to fix it.

I'll try that shortly - many thanks, I went a bit cross-eyed looking at
the module!


-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

This is not an automated signature. I type this in to the bottom of every
message. 

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


[Catalyst] HTML::FillInForm (1.06) - a bug?

2006-09-27 Thread Chisel Wright
Does anyone know if TJ Mather is still alive/maintaining this module?
I'm fairly sure it's a bug, but it's been a couple of weeks with no
reply.

Chisel

 forwarded message 
Hi there,

I've attached a small test-script for what I believe is a bug in the
HTML::FillInForm module.

It seems that if the module is passed a scalarref of plain text (i.e. no
HTML markup), it chops off the last work in the string.

I don't think this should happen, but you may disagree,
 forwarded message 
-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

This is not an automated signature. I type this in to the bottom of every
message. 


HTML-FillInForm.t
Description: Troff document
./HTML-FillInForm
#   Failed test 'output and content should be the same'
#   in ./HTML-FillInForm.t at line 31.
#  got: undef
# expected: '404'

#   Failed test 'output and content should be the same'
#   in ./HTML-FillInForm.t at line 31.
#  got: '404 Not'
# expected: '404 Not Found'

#   Failed test 'output and content should be the same'
#   in ./HTML-FillInForm.t at line 31.
#  got: 'Hello'
# expected: 'Hello World'
# Looks like you failed 3 tests of 4.
dubious
Test returned status 3 (wstat 768, 0x300)
DIED. FAILED tests 1-3
Failed 3/4 tests, 25.00% okay
Failed Test Stat Wstat Total Fail  Failed  List of Failed
---
./HTML-FillInForm.t3   768 43  75.00%  1-3
Failed 1/1 test scripts, 0.00% okay. 3/4 subtests failed, 25.00% okay.
___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] ->model-> return values?

2006-09-25 Thread Chisel Wright
On Mon, Sep 25, 2006 at 07:04:32AM -0700, Roderick A. Anderson wrote:
> So if an update query should fail because NULL got passed to a NOT NULL 
> field, a letter got into an INT field, etc. or an delete fails because 
> the key doesn't exist.  I'm looking to determine if the update or delete 
> succeeds then do one thing if it fails then another.

Run it (in a transaction) in an eval{} block, then check [EMAIL PROTECTED]

-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

This is not an automated signature. I type this in to the bottom of every
message. 

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


Re: [Catalyst] Session cookie and permanent state

2006-09-23 Thread Chisel Wright
On Sat, Sep 23, 2006 at 06:05:40AM -0700, Bill Moseley wrote:
> I'd use a separate cookie for "remember me" -- I think that's
> different then from the session.

Are there any apps/articles that illustrate how to do "remember me"
sensibly and securely?


-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

This is not an automated signature. I type this in to the bottom of every
message. 

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


[Catalyst] Mango

2006-08-22 Thread Chisel Wright
This popped up in one of my feeds - looks like something to keep an eye
on - I know I'm interested to see the end results:

http://news.perlfoundation.org/2006/08/grant_approved_mango.html

-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

This is not an automated signature. I type this in to the bottom of every
message. 

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


Re: [Catalyst] how to get started?

2006-08-21 Thread Chisel Wright
On Mon, Aug 21, 2006 at 08:08:19AM -0700, Steve Atkins wrote:
> Task::Catalyst is completely broken.

Just out of interest, in what way?

-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

This is not an automated signature. I type this in to the bottom of every
message. 

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


Re: [Catalyst] how to get started?

2006-08-21 Thread Chisel Wright
On Mon, Aug 21, 2006 at 12:40:03PM +0200, Thomas Hartman wrote:
>One observation I will make, which will probably not be news to many of
>you, is that most of the breakage I see happens in the test phase of the
>install.

Yeah, I suspect that if I didn't run any tests and just blindly
installed everything, it would be a hell of a lot easier. :-)



-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

This is not an automated signature. I type this in to the bottom of every
message. 

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


Re: [Catalyst] how to get started?

2006-08-21 Thread Chisel Wright
On Mon, Aug 21, 2006 at 11:47:26AM +0200, Thomas Hartman wrote:
>Having trouble with just cpan, and was suggested to use cpan plus.

I find that some modules install better with cpan, and others with
cpanplus

I think I'm primarily using cpan, but in an ideal world I'd be creating
deb/ubuntu packages for everything and installing those.
(the "official" ones are terribly out of date)

-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

This is not an automated signature. I type this in to the bottom of every
message. 

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


Re: [Catalyst] auth::DBIC & session problems

2006-08-15 Thread Chisel Wright
On Tue, Aug 15, 2006 at 12:01:34PM -0400, [EMAIL PROTECTED] wrote:
>Am I the only person with this problem? Is anybody else using DBIC for the
>Authentication Store?

This rings a vague bell - I think I jsut moved some of my things out of
->session and did an auto() lookup, storing things in ->stash instead.

Not ideal, but I can't remember what the advice/solution was when I hit
this myself some time ago.
-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

This is not an automated signature. I type this in to the bottom of every
message. 

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


Re: [Catalyst] SOLUTION: Re: Authentication::Store::DBIC worksundermyapp_server.pl butnot Apache/mod_perl

2006-08-12 Thread Chisel Wright
On Sat, Aug 12, 2006 at 11:21:36PM +0100, Joel Bernstein wrote:
> On Sat, Aug 12, 2006 at 01:57:27PM -0700, Rodney Broom wrote:
> > From: "Jonathan Rockway" <[EMAIL PROTECTED]>
> > 
> > > Interesting version of diff there.
> > 
> > These were diff -c, which patch(1) is happy with. Can you tell me what 
> > format (in diff(1)) you're refering to?
> 
> Unified-context diffs, aka diff -u. That's the standard way for patches
> to be distributed, AFAIK.

There's a nice section titled 'NOTES FOR PATCH SENDERS' in 'man patch'
:-)


-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

This is not an automated signature. I type this in to the bottom of every
message. 

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


Re: [Catalyst] Storing a password hash with DBIC

2006-08-10 Thread Chisel Wright
On Thu, Aug 10, 2006 at 04:19:14PM +0100, Jonas wrote:
> Thanks, that's exactly what i need. :)
> 
> >
> > http://search.cpan.org/dist/DBIx-Class-DigestColumns/


Sounds good for something I want too .. shame the deps are being a bitch
to install.


-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

This is not an automated signature. I type this in to the bottom of every
message. 

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


Re: [Catalyst] [Announce] Planet Catalyst

2006-08-04 Thread Chisel Wright
On Thu, Aug 03, 2006 at 10:57:47AM -0700, John Wang wrote:
>I just set up Planet Catalyst at [1]http://planet.catalystframework.org to
>aggregate blogs about Catalyst . It is linked from the main Catalyst

Syndication for the LJ-ers out there:

  http://syndicated.livejournal.com/planet_catalyst/

Chisel
-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

This is not an automated signature. I type this in to the bottom of every
message. 

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


Re: [Catalyst] ::Model::SomeTable->some_method() problem

2006-07-18 Thread Chisel Wright
On Mon, Jul 17, 2006 at 10:58:49AM +0100, Chisel Wright wrote:
> I've not yet redeployed Parley on my machine, so I can't (yet) confirm
> that it works there. I can't see any reason why it shouldn't, but I'll
> redeploy and confirm in the next day or so.

OK, Parley redeployed last night. Tested on the train this morning.

After a find_or_create() glitch (solved by moving up to DBIC dev-release
again) everything seems to work just as I'd expect it to.


-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

This is not an automated signature. I type this in to the bottom of every
message. 

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


Re: [Catalyst] ::Model::SomeTable->some_method() problem

2006-07-17 Thread Chisel Wright
On Sat, Jul 15, 2006 at 11:18:04PM -0300, Brian Cassidy wrote:
> We've checked in a potential fix (+ tests) [1]. Please download it and
> test it :)
> 
> -Brian
> 
> [1] http://dev.catalyst.perl.org/changeset/4701

I've just tried this on my own smaller test-case, where I no longer get
the error I posted about.

I've not yet redeployed Parley on my machine, so I can't (yet) confirm
that it works there. I can't see any reason why it shouldn't, but I'll
redeploy and confirm in the next day or so.

Cheers,

Chisel
-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

This is not an automated signature. I type this in to the bottom of every
message. 

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


Re: [Catalyst] ::Model::SomeTable->some_method() problem

2006-07-14 Thread Chisel Wright
On Fri, Jul 14, 2006 at 08:56:12AM -0500, Brandon Black wrote:
> There was one other guy who popped into #catalyst complaining about a
> messed up Model::CDBI model from the same bug, so you're not
> *completely* alone - you're just in unfavorable company :)

Oh, I thought you lot were the unfavourable bunch ;-)

-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

This is not an automated signature. I type this in to the bottom of every
message. 

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


Re: [Catalyst] ::Model::SomeTable->some_method() problem

2006-07-14 Thread Chisel Wright
On Fri, Jul 14, 2006 at 03:03:59AM +0100, Matt S Trout wrote:
> It's a bug. Shame nobody using a setup like yours can have tested the  
> dev releases like we asked.

Yes, I did (half) apologise for this in my first post. I realise it's
the fault of people like me.

I just hadn't had the tuits to slap the dev release on my laptop. It
kinda sounds like I'm the only Pg/Model::DBIC user out there at the
moment ... :)


-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

This is not an automated signature. I type this in to the bottom of every
message. 

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


Re: [Catalyst] ::Model::SomeTable->some_method() problem

2006-07-13 Thread Chisel Wright
On Thu, Jul 13, 2006 at 12:49:21PM +0100, Ash Berlin wrote:
> 1) You should really think about converting to DBIC::Schema instead.

Yes, I'd like to, but I have no idea where to start.

> 2) What version were you upgrading from?

Um, 5.6x, in the cases where I upgraded and didn't install on a fresh
box.

> 3) Did you also upgrade anything else?

I just did:
  install Catalyst
  install Catalyst::Devel

I wasn't watching that closely, but I'm sure CPAN upgraded Other
Stuff/dependencies

> 4) You probably want some_method to be a method on the result_set: i.e. 
> something like the following: 
> http://search.cpan.org/~jrobinson/DBIx-Class-0.06003/lib/DBIx/Class/ResultSetManager.pm

I'll look into that.


-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

This is not an automated signature. I type this in to the bottom of every
message. 

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


Re: [Catalyst] ::Model::SomeTable->some_method() problem

2006-07-13 Thread Chisel Wright
On Tue, Jul 11, 2006 at 10:51:15AM +0100, Chisel Wright wrote:
> Do I have a corrupt install after upgrading, or is this a bug?

OK, I've tried this on:

  Ubuntu, upgraded catalyst
  Gentoo, upgraded catalyst
  Ubuntu, totally fresh install, fresh catalyst

All three fail to locate the ::Model::Class object method running under
the Catalyst server/test scripts.

Is anyone else using 5.7 and models with extra user-defined functions?

I'm just surprised that this seems to be happening everywhere for me,
and no-one else seems to have any problem.


Does anyone have 5-10 minutes to try the test(s) I outlined in my
previous message?

Chisel
-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

This is not an automated signature. I type this in to the bottom of every
message. 

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


Re: [Catalyst] Catalyst Debug Screen

2006-07-11 Thread Chisel Wright
On Tue, Jul 11, 2006 at 08:50:33PM +0100, Jonathan Tweed wrote:
> It's certainly not as pretty as the old one, but it's a lot easier to  
> read.

At least I can read this one.

The p[revious one had a glitch (for me) where the request/stash output
had same bg/fg colours.
-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

This is not an automated signature. I type this in to the bottom of every
message. 

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


Re: [Catalyst] ::Model::SomeTable->some_method() problem

2006-07-11 Thread Chisel Wright
On Tue, Jul 11, 2006 at 11:05:58AM +0100, Ash Berlin wrote:
> What about Catalyst::Runtime?

[EMAIL PROTECTED]:~# cpan Catalyst::Runtime
CPAN: Storable loaded ok
Going to read /root/.cpan/Metadata
  Database was generated on Mon, 10 Jul 2006 07:29:23 GMT
Catalyst::Runtime is up to date.

[EMAIL PROTECTED]:~/model_method/ClassMethod$ perl -MCatalyst::Runtime -le \
 'print Catalyst::Runtime->VERSION;'
5.7000

-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

This is not an automated signature. I type this in to the bottom of every
message. 

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


Re: [Catalyst] ::Model::SomeTable->some_method() problem

2006-07-11 Thread Chisel Wright
On Mon, Jul 10, 2006 at 02:42:22PM +0100, Chisel Wright wrote:
> The only thing that's changed since I got off the train this morning is
> my upgrade to 5.7. Any ideas?

This morning I decided to boil my problem down to a simpler test-case
(attached), to make it easier to demonstrate/test my problem.

This morning I copied the test across to another box, running 5.61,
where they pass.

I then did:

  cpan Catalyst::Devel
  cpan Catalyst

and re-ran the test, which failed, the same as on my laptop.

Do I have a corrupt install after upgrading, or is this a bug?


I've attached the files that should be required for testing.


Chisel
-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

This is not an automated signature. I type this in to the bottom of every
message. 
1. Create database

 createdb -E UTF8 classmethod
 psql -d classmethod -f db/classmethod.sql

2. Create DB Model

 ./script/classmethod_create.pl model CMDB DBIC dbi:Pg:dbname=classmethod

3. Add a method to the ClassMethod class

  vi ./lib/ClassMethod/Model/CMDB/ClassMethod.pm

# add:
sub some_method {
my $self = shift;
return 1;
}

4. Add a call to the default controller

  vi ./lib/ClassMethod/Controller/Root.pm

  # add to sub default():
$c->model('CMDB')->table('class_method')->some_method();

5. Add a test

  vi ./t/model_CMDB-ClassMethod.t

  # increase number of tests to 3
  # add following test:
can_ok('ClassMethod::Model::CMDB::ClassMethod', qw/ some_method /);

6. Run the test

  prove --lib --verbose t/model_CMDB-ClassMethod.t

All tests should pass, we're specifically interested in:

  ok 3 - ClassMethod::Model::CMDB::ClassMethod->can('some_method')

7. Run the application

  ./script/classmethod_test.pl / 2>&1 |grep 'class="error"'

If there are any application errors, you'll see them, otherwise you'll see 
nothing.


8. Drop database

  dropdb classmethod
-- createdb -E UTF 8 classmethod

BEGIN;

CREATE TABLE class_method (
id  SERIAL  primary key,
int1integer default 1,
text1   textdefault 'one'
);

COMMIT;
[EMAIL PROTECTED] ClassMethod $ prove --lib --verbose t/model_CMDB-ClassMethod.t
t/model_CMDB-ClassMethod1..3
[debug] Debug messages enabled
[debug] Loaded plugins:
..
| Catalyst::Plugin::ConfigLoader  0.06   |
| Catalyst::Plugin::Static::Simple  0.14 |
''

[debug] Loaded dispatcher "Catalyst::Dispatcher"
[debug] Loaded engine "Catalyst::Engine::CGI"
[debug] Found home 
"/home/chisel/development/svk/parley/issues/model_method/ClassMethod"
[debug] Loaded tables "class_method"
[debug] Loaded components:
.-+--.
| Class   | Type |
+-+--+
| ClassMethod::Controller::Root   | instance |
| ClassMethod::Model::CMDB| instance |
| ClassMethod::Model::CMDB::ClassMethod   | class|
| ClassMethod::Model::CMDB::_db   | class|
'-+--'

[debug] Loaded Private actions:
.--+--+--.
| Private  | Class| Method   |
+--+--+--+
| /default | ClassMethod::Controller::Root| default  |
| /end | ClassMethod::Controller::Root| end  |
'--+--+--'

[info] ClassMethod powered by Catalyst 5.7000
ok 1 - use Catalyst::Test;
ok 2 - use ClassMethod::Model::CMDB::ClassMethod;
ok 3 - ClassMethod::Model::CMDB::ClassMethod->can('some_method')
ok
All tests successful.
Files=1, Tests=3,  1 wallclock secs ( 1.12 cusr +  0.14 csys =  1.26 CPU)




[EMAIL PROTECTED] ClassMethod $ ./script/classmethod_test.pl / 2>&1 |grep 
'class="error"'
Caught exception 
in ClassMethod::Controller::Root->default "Can't locate object 
method "some_method" via package 
"ClassMethod::Model::CMDB::ClassMethod" at 
/home/chisel/development/svk/parley/issues/model_method/ClassMethod/script/../lib/ClassMethod/Controller/Root.pm
 line 32."
[EMAIL PROTECTED] ClassMethod $

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


[Catalyst] ::Model::SomeTable->some_method() problem

2006-07-10 Thread Chisel Wright
Firstly, this was working on the train this morning (before I upgraded
to the 5.7000 release).
Secondly, yes I should have upgraded to a -dev version and tested this
before now.

Right, onto the problem.

I have:


package Parley::Model::ParleyDB::Post;
...
sub last_post_in_list {
 ...
}
...
1;


and in Parley::Controller::Thread I have:


$last_post = $c->model('ParleyDB')->table('post')->last_post_in_list(
  $c->stash->{post_list}
);


Up until this morning, the call worked just fine, however since
upgrading to 5.7000 I'm getting the application debug screen with the
following error:

Caught exception in Parley::Controller::Thread->view "Can't locate
object method "last_post_in_list" via package
"Parley::Model::ParleyDB::Post" at
/home/chisel/development/svk/parley/script/../lib/Parley/Controller/Thread.pm
line 74."


I've added a can_ok() test t/model_Parley-Post.t which passes with
last_post_in_list in the function list.


I'm not using Schema stuff (yet), I'd like to move in that direction,
but I haven't taken the time to find out how to do this yet. At the
moment I have:


package Parley::Model::ParleyDB;
use strict;
use base 'Catalyst::Model::DBIC';

__PACKAGE__->config(
dsn   => 'dbi:Pg:dbname=parley',
user  => 'parley',
password  => undef,
options   => {
AutoCommit => 1,
},
relationships => 1,

    debug   => 0,
);



The only thing that's changed since I got off the train this morning is
my upgrade to 5.7. Any ideas?

Chisel
-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

This is not an automated signature. I type this in to the bottom of every
message. 

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


Re: [Catalyst] data::dump vs data::dumper

2006-07-06 Thread Chisel Wright
On Thu, Jul 06, 2006 at 03:55:45PM +0100, Matt S Trout wrote:
> > Sounds sane. Sounds like I have some thinking/work to do for 0.0.3. :)
> 
> Sorry :)

No problem, I kinda hacked it together without knowing better. Know I
know there's a better/preferred way, I can improve it - that's what
open-source is all about innit? :)

> > Chisel - distracted after taking photos at a lingerie fashion show
> 
> Bastard.

Hahahahahahaha!

-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

This is not an automated signature. I type this in to the bottom of every
message. 

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


Re: [Catalyst] data::dump vs data::dumper

2006-07-06 Thread Chisel Wright
On Thu, Jul 06, 2006 at 02:08:42PM +0100, Matt S Trout wrote:
> Catalyst::Plugin::Dumper is ... err ... not sanely architected. It stuffs the 
> Catalyst::Log namespace with an extra method, which (a) is a global change 
> that could stomp on other code in the same process, and (b) will completely 
> fail to work if you replace your logger.

Fair enough - this is the first piece of feedback I've had on the
module.
I was sort-of workng on the basis "It does what I want, and no-one's
complained". I'm kinda surprised that it appears to be used so much.

> How about a plugin that offers a $c->dump_data($data) method and allows a 
> config option to use ::Dumper or ::Dump as preferred.

Sounds sane. Sounds like I have some thinking/work to do for 0.0.3. :)

Chisel - distracted after taking photos at a lingerie fashion show
-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

This is not an automated signature. I type this in to the bottom of every
message. 

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


[Catalyst] Catalyst::Plugin::Dumper [was: data::dump vs data::dumper]

2006-07-06 Thread Chisel Wright
On Thu, Jul 06, 2006 at 11:59:33AM +0200, Marcello Romani wrote:
> The (beginners') docs could mention dump() instead of dumper(), or at 
> least state that dumper() is deprecated in favour of dump().

Do two people on this list constitute "deprecated in favour of XXX"? :)

Obviously I'll update the docs to show the new method, and I'll probably
even list it first, but I don't see any reasong to deprecate the
Data::Dumper method - some people might prefer it, and it doesn't do any
harm.

-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

This is not an automated signature. I type this in to the bottom of every
message. 

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


Re: [Catalyst] data::dump vs data::dumper

2006-07-06 Thread Chisel Wright
On Thu, Jul 06, 2006 at 09:28:23AM +0200, Marcello Romani wrote:
> FWIW, I prefer Data::Dump over Data::Dumper, too.

I was thinking about this a little last night.

How about leaving the dumper() method as-is (since Data::Dumper is core
I believe) and adding a new method dump() - which is in keeping with the
Data::Dump function name?

This then doesn't affect anyone who's happy with Dumper, and opens it up
for people who prefer Dump.

Chisel
-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

This is not an automated signature. I type this in to the bottom of every
message. 

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


Re: [Catalyst] data::dump vs data::dumper

2006-07-05 Thread Chisel Wright
On Wed, Jul 05, 2006 at 10:04:05PM +0200, Krzysztof Krzyżaniak wrote:
> Thanks for the answer. Someone know if Catalyst::Plugin::Dumper will
> switch to Data::Dump as well (or maybe accept patch for that)?

Well you could email the author directly, or hope he stumbles across it
here ;-)

I'll look into it, if it's the preferred dumping module now.

Chisel
-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

This is not an automated signature. I type this in to the bottom of every
message. 

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