Re: [Catalyst] How do I pull out HTML::Widget result values?

2006-12-26 Thread Mark Zealey
I usually just do sth like: if($result-have_errors) { display form; return } # otherwise: my $p = $c-req-params; # We know that the params are valid now... Mark On Tuesday 26 December 2006 6:01 pm, Dennis Daupert wrote: This is throwing me down the stairs. I'm trying to pull out individual

[Catalyst] Accessing $c from Model

2006-12-27 Thread Mark Zealey
Hi there, I'm basically wanting to write a simple log function which logs hits on my website as entries in a database (automatically adding $c-user-{id} and $c-req-referrer etc), but to do so I want to use a model (I think). Any ideas how I can just say $c-model('Log')-info(foo) and

Re: [Catalyst] Various login problems

2006-12-27 Thread Mark Zealey
that's cos the database connection has gone away (it happens after about 20 min) and the DBD driver for you database doesnt have autoreconnect set. This is a DBD:: specific thing - the way for mysql databases is to set mysql_auto_reconnect to true in the DBI connection options (which iirc you

Re: [Catalyst] Accessing $c from Model

2006-12-27 Thread Mark Zealey
On Wednesday 27 December 2006 1:01 pm, Ash Berlin wrote: Very very *VERY* bad idea. __PACKAGE__-mk_accessors(context); sub ACCEPT_CONTEXT { my ($self, $c, @args) = @_; my $new = bless({ %$self }, ref $self); $new-context($c); return $new; } Isn't that really really slow

Re: [Catalyst] formbuilder method in C::C::FormBuilder not located

2007-02-01 Thread Mark Zealey
I'm guessing you didn't change the line which says: use base 'Catalyst::Controller'; to: use base 'Catalyst::Controller::FormBuilder'; Mark On Thursday 01 February 2007 8:39 pm, rahed wrote: Hi, starting with Catalyst, I went through CatalystBasics tutorial. From the archive I concluded

Re: [Catalyst] Using $c-view('TT')-render for emails

2007-02-06 Thread Mark Zealey
I'd just create a separate TT view instance eg i call my website view 'C::V::Website' and my email view 'C::V::Email' and then just parse it through that - means you can have different dirs /root/website and /root/email with different variables - the email and website views are generally very

[Catalyst] viewing catalyst memory usage

2007-02-12 Thread Mark Zealey
Hi there, Is there any (vaguely simple?) way to see where all the memory is being used in a catalyst application? This kinda follows on from the previous thread on mod_perl memory usage, but I'd like to use something like Devel::Monitor or Devel::ObjectTracker to monitor all objects created by

Re: [Catalyst] Re: looping

2007-02-14 Thread Mark Zealey
You could of course do somethnig like: push @lname = $c-model('myDB::Author')-get_column('last_name')-all; tmtowtdi Mark On Wednesday 14 February 2007 5:21 pm, A. Pagaltzis wrote: Hi Ian, * Ian Docherty [EMAIL PROTECTED] [2007-02-14 16:40]: A. Pagaltzis wrote: * Will Smith [EMAIL

Re: [Catalyst] Using C::C::FormBuilder With DBIC

2007-02-18 Thread Mark Zealey
wrt radioboxes on forms/dbic; I have been doing a true/false/null using the following: invited: label: Invited? options: 1=Yes, 0=No required: 0 As this is not required, if nothing is sent back the value will be undef = null; otherwise 1/0 will be returned based on

Re: [Catalyst] todo list for FormBuilders (was the l10n thread)

2007-02-20 Thread Mark Zealey
Something else i wanted to do was to be able to define 'blocks' which would go on my form; for example: form: INCLUDE 'name.fb' INCLUDE 'address.fb' To get a default name block and then an address block appended to my form. Using HTML::Widget you could do -merge which is something i'm yet

[Catalyst] Bug with POSTs using cat 5.7007, and parse_on_demand = 1

2007-05-18 Thread Mark Zealey
Hi, I have found a bug with catalyst, when Catalyst::Engine::HTTP is used with parse_on_demand set to true, and POST content. when I post, the connection 'hangs'. if i hit esc in the browser, I get the following cat output: Can't call FIRSTKEY method on handle DBI::db=HASH(0x9858670) after

Re: [Catalyst] Bug with POSTs using cat 5.7007, and parse_on_demand = 1

2007-05-18 Thread Mark Zealey
After spending the past two hours looking through code etc, I finally discovered this was a bug of my own making. Basically, I've written a custom little FormBuilder controller module that loads .pm files with formbuilder specs. As part of that, it specified that it wanted { params = $c-req },

[Catalyst] Mapping urls inside catalyst

2007-05-19 Thread Mark Zealey
Hi, I'm trying to work out the 'best way' of solving the following problem. Basically, I want to have several entries into my application. One is of the form /foo/id where id is an integer primary key. Another is /bar/other_key where other_key is some string key, and another is via a virtual

Re: [Catalyst] Mapping urls inside catalyst

2007-05-19 Thread Mark Zealey
the url back into catalyst... Mark On Saturday 19 May 2007 9:18 pm, Robert 'phaylon' Sedlacek wrote: Mark Zealey wrote: Hi, I'm trying to work out the 'best way' of solving the following problem. Basically, I want to have several entries into my application. One is of the form /foo/id

[Catalyst] Redispatching actions

2007-05-20 Thread Mark Zealey
Hi there, I was wondering if there was some way within the Catalyst api to redispatch calls. The problem I'm having is: package MyApp::C::Blah; sub add : Local :Form(...) { if($form-submitted) { # Add to database $c-res-redirect($c-uri_for('view')) } # Generate form and display }

Re: [Catalyst] Re: Redispatching actions

2007-05-22 Thread Mark Zealey
You said absolutely nothing to address the “wrong URL” problem Matt mentioned, btw. What wrong URL? My example showed that http://example.com/data/update is virtually equal to http://example.com/data/view if not posted from a form. Of course they are virtually equal – after all

Re: [Catalyst] Automatic structure creation from form data

2007-07-03 Thread Mark Zealey
check out Catalyst::Controller::FormBuilder - it'll autogenerate your forms for you, handle validation etc etc. M On Tuesday 03 July 2007 7:19 pm, Andrew Hayward wrote: I'm relatively new to this Catalyst malarkey, so you'll have to bear with me for a minute. I was wondering if it possible

Re: [Catalyst] what do you do when your app hangs without explanation?

2007-07-08 Thread Mark Zealey
In the debugger you can just hit ctl-c when it's looping and it'll stop your program and tell you where you are, stack frames etc.. M On Sunday 08 July 2007 6:30 pm, Daniel McBrearty wrote: in the middle of working on another part of the app altogether, suddenly when I start up, just trying

Re: [Catalyst] Proper way to perform cleanups on server shutdown?

2007-07-11 Thread Mark Zealey
Perhaps I'm missing something, but what's the problem with doing something like: package MyApp; $SIG{INT} = sub { graceful_shutdown(); exit(1); } END { graceful_shutdown() } sub graceful_shutdown { # Code here... } Note that a $SIG{INT} will not exit if you override it, which is why

Re: [catalyst] conditional loading of Controllers and Models

2007-07-16 Thread Mark Zealey
I use: package MyApp; use Catalyst qw/ ... /; my @extra_plugins; if( $ENV{CATALYST_DEBUG} ) { push @extra_plugins = qw/ Static::Simple StackTrace /; } # Start the application __PACKAGE__-setup( @extra_plugins ); Mark On Monday 16 July 2007 1:48 pm, Daniel McBrearty wrote: is there a

Re: [Catalyst] Catalyst Hosting

2007-08-09 Thread Mark Zealey
I work for pipex hosting, who own 123-reg. 123-reg have cheap dedi servers (from £40/mo) running ubuntu (http://www.123-reg.co.uk/dedicated-server-hosting/). You can get root access (actually a chroot, but you get full control of the box and the ip) and we even put catalyst on there as

Re: [Catalyst] get the path to the home

2007-09-28 Thread Mark Zealey
The __FILE__ compile-time constant may be of some use.. You should be able to get the directory of the current module by doing something like: package MyApp::I18N::foo; use strict; sub get_my_dir { my ($dir) = __FILE__ =~ m!^ (.*) / [^/]+ !x; return $dir; } Of course, if you wanted to do