Re: [Catalyst] plat_forms report published on June 20th. 2007. Geneva team on Catalyst wins the Perl track.

2007-06-20 Thread mla
Cédric Bouvier wrote: Unfortunately, the requirements just included a WSDL file, and the words implement that!. So we were doomed. The pressure and lack of sleep must have blinded me, for I didn't give up at once, and wasted valuable time trying to get something working. I'm no expert on SOAP,

Re: [Catalyst] plugins; was Re: debug mode

2007-06-07 Thread mla
Matt S Trout wrote: On Thu, Jun 07, 2007 at 03:55:16AM -0700, Jonathan Swartz wrote: mia wrote: Matt S Trout wrote: On Wed, Jun 06, 2007 at 02:18:33PM -0700, mla wrote: Assuming I'm not using threads, how would I hurt myself by subclassing Catalyst and supplying a MyApp-context that returns

Re: [Catalyst] DNS as a Catalyst Model

2007-06-07 Thread mla
Leo Cacciari wrote: I'm planing to develop a Catalyst::Model::DNS, allowing Catalyst applications to access (and update through dynamic queries) a Domain Name Service. What's the benefit of making this a *Catalyst* model? Doesn't that couple your DNS module to your web framework? Why not just

Re: [Catalyst] DNS as a Catalyst Model

2007-06-07 Thread mla
Leo Cacciari wrote: Il giorno gio, 07/06/2007 alle 13.10 -0700, mla ha scritto: What's the benefit of making this a *Catalyst* model? Doesn't that couple your DNS module to your web framework? Why not just write a DNS module with all your dynamic update methods and then add a wrapper to use

Re: [Catalyst] plugins; was Re: debug mode

2007-06-07 Thread mla
Matt S Trout wrote: On Thu, Jun 07, 2007 at 01:04:02PM -0700, mla wrote: Other than the fact you don't like the style, why is it bad? You don't like singletons? I'm not fond of any magic global if I can possibly avoid it - I find it tends to encourage tight coupling of code and action

Re: plugins; was Re: [Catalyst] debug mode

2007-06-06 Thread mla
Matt S Trout wrote: On Tue, Jun 05, 2007 at 01:42:42PM -0700, Michael Reece wrote: sub _ACTION : Pricvate { my ($self, $c) = @_; $self-_context($c); $self-SUPER::_ACTION($c); } That's not only in the wrong place to work for begin/end/auto it screws up the destruction process and

Re: plugins; was Re: [Catalyst] debug mode

2007-06-06 Thread mla
Matt S Trout wrote: On Wed, Jun 06, 2007 at 02:18:33PM -0700, mla wrote: Matt S Trout wrote: On Wed, Jun 06, 2007 at 12:29:12PM -0700, mla wrote: Is it not possible to offer the current Catalyst instance through a class method? Something analogous to Apache-request, rather than having to do

Re: [Catalyst] deploying a Catalyst app

2007-06-01 Thread mla
Octavian Rasnita wrote: Hi, Please tell me where can I find more information about deploying a Catalyst app. I think there should be a way of creating a tarball with the whole app, including the entire application. When installing it on the target machine (with make, make install) it should

Re: [Catalyst] Duplicate session ids

2007-05-26 Thread mla
mla wrote: Bill Moseley wrote: On Sat, May 26, 2007 at 04:08:48PM -0400, Perrin Harkins wrote: On 5/26/07, Bill Moseley [EMAIL PROTECTED] wrote: Perhaps an easier way to show the problem with duplicate created sessions would help. Do you mean duplicate or multiple? The session ID generation

Re: [Catalyst] ActiveRecord for Perl

2007-05-22 Thread mla
Adam Bartosik wrote: I'm considering trying to port Ruby's ActiveRecord to Perl as a lightweight ORM option (with some small changes maybe, like composite PKs). If anyone's interested, toss me a message privately and we'll coordinate. What I found missing in DBIx::Class is AR method

Re: [Catalyst] ActiveRecord for Perl

2007-05-22 Thread mla
John Napiorkowski wrote: --- Eduard Giménez [EMAIL PROTECTED] wrote: I'm considering trying to port Ruby's ActiveRecord to Perl as a lightweight ORM option (with some small changes maybe, like composite PKs). If anyone's interested, toss me a message privately and we'll coordinate. Why

Re: [Catalyst] ActiveRecord for Perl

2007-05-22 Thread mla
Perrin Harkins wrote: On 5/22/07, Adam Bartosik [EMAIL PROTECTED] wrote: What I found missing in DBIx::Class is AR method find_by_sql(sql). Did you ask about it on the mailing list? Nearly all of the Perl ORMs have support for direct SQL. I don't know DBIx::Class, but search_literal sounds

Re: [Catalyst] Constants that refer to rows in a lookup table.

2007-05-22 Thread mla
Bill Moseley wrote: On Tue, May 22, 2007 at 04:36:06PM -0700, mla wrote: The PKs seem arbitrary in this case. I don't know if they should be referenced at all. I'd tend to use a subselect... UPDATE carts SET cart_status_id = ( SELECT id FROM cart_status WHERE name = 'Completed

Re: [Catalyst] Constants that refer to rows in a lookup table.

2007-05-22 Thread mla
Bill Moseley wrote: On Tue, May 22, 2007 at 05:57:15PM -0700, mla wrote: Consider this change... create table cart_status ( id SERIAL PRIMARY KEY, status text UNIQUE NOT NULL nametext NOT NULL, active boolean NOT NULL DEFAULT TRUE ); Now there's two primary

[Catalyst] ActiveRecord for Perl

2007-05-21 Thread mla
I'm considering trying to port Ruby's ActiveRecord to Perl as a lightweight ORM option (with some small changes maybe, like composite PKs). If anyone's interested, toss me a message privately and we'll coordinate. Maurice ___ List:

Re: [Catalyst] Re: Form validation in insert() and update()?

2007-05-20 Thread mla
A. Pagaltzis wrote: * Dave Rolsky [EMAIL PROTECTED] [2007-05-20 16:40]: If the action is a create or update, you want to redirect to the URI for the thing being created or updated. You may _also_ want to include some form successfully updated message, so this pattern works well for this. That's

Re: [Catalyst] Encrypt /Decrypt URI

2007-05-18 Thread mla
Bill Moseley wrote: Using md5s for images, as in your example, is fine. But if the images really needed to be protected then that scheme is purely security by obscurity. That's what we were talking about -- the case where some user might type in the next sequence and see someone else's data.

Re: [Catalyst] Form validation in insert() and update()?

2007-05-17 Thread mla
Matt S Trout wrote: On Wed, May 16, 2007 at 06:46:57PM -0700, mla wrote: I'm thinking Catalyst::Model should provide some sort of interface for this. This doesn't belong at the Catalyst core level since Catalyst is expressly -not- opinionated about how your model is written

Re: [Catalyst] Form validation in insert() and update()?

2007-05-16 Thread mla
Jason Gottshall wrote: This gets at precisely the issue I've been wrestling with lately. Validation constraints at all levels (db, model, controller, form, etc.) seem to sort themselves into two general categories: field-specific questions (Is it required/unique?, Does it match a given pattern?,

Re: [Catalyst] catalyst tutorial: MyAppDB/Book.pm vs. MyApp/Model/Book.pm

2007-05-15 Thread mla
Marcello Romani wrote: In MyApp/Model I usually have only MyAppDB.pm, which role is to expose the DBIC::Schema classes under MyAppDB/ as a catalyst model. This doesn't mean however that I would never create anything else. If all I need is one dbic schema, then the answer to your question is

Re: [Catalyst] catalyst tutorial: MyAppDB/Book.pm vs. MyApp/Model/Book.pm

2007-05-15 Thread mla
Anthony Gardner wrote: Have a look at this for another angle http://www.teambarry.com/?p=38 Ah, I like this approach very much. It says: So how do you get some of the advantages of ORM and keep control over SQL? I employ composition and a couple basic design patterns. For example, I have

Re: [Catalyst] catalyst tutorial: MyAppDB/Book.pm vs. MyApp/Model/Book.pm

2007-05-15 Thread mla
Matt S Trout wrote: On Tue, May 15, 2007 at 12:10:15AM -0700, mla wrote: But I'm thinking a better layout would be: /lib ./lib/Try ./lib/Try/Catalyst/Model ./lib/Try/Catalyst/Model/DB.pm ./lib/Try/Catalyst/View ./lib/Try/Catalyst/View/TT.pm ./lib/Try/Catalyst/Controller ./lib/Try/Catalyst

Re: [Catalyst] catalyst tutorial: MyAppDB/Book.pm vs. MyApp/Model/Book.pm

2007-05-15 Thread mla
Matt S Trout wrote: On Tue, May 15, 2007 at 01:19:53AM -0700, mla wrote: So how do you get some of the advantages of ORM and keep control over SQL? I employ composition and a couple basic design patterns. For example, I have a base model factory interface that uses chainable “Loader” modules

Re: [Catalyst] Form validation in insert() and update()?

2007-05-15 Thread mla
Perrin Harkins wrote: On 5/14/07, Dave Rolsky [EMAIL PROTECTED] wrote: eval { $user-update( %bunch_of_stuff ); }; if ( my $e = Exception::Class-caught( 'My::App::Exception::DataValidation') ) { # $e-errors contains multiple data validation error messages # stuff

Re: [Catalyst] catalyst tutorial: MyAppDB/Book.pm vs. MyApp/Model/Book.pm

2007-05-15 Thread mla
Daniel Hulme wrote: On Tue, May 15, 2007 at 01:24:17PM +0100, Matt S Trout wrote: On Tue, May 15, 2007 at 03:47:57AM -0700, mla wrote: I like how if you fetch columns that don't exist in the table the object becomes read-only by default. That's neat, although I prefer tools that presume I

Re: [Catalyst] catalyst tutorial: MyAppDB/Book.pm vs. MyApp/Model/Book.pm

2007-05-15 Thread mla
Matt S Trout wrote: On Tue, May 15, 2007 at 03:47:57AM -0700, mla wrote: So with that design you'd get the centralized validation, which is most critical to me, but then you could use SQL freely and get back a collection of read-only active record objects if you did fancy stuff. You -can

Re: [Catalyst] Form validation in insert() and update()?

2007-05-15 Thread mla
Matt S Trout wrote: On Tue, May 15, 2007 at 02:51:18PM -0400, Christopher H. Laco wrote: where do you handle the validation? Only in the controller or in both the model and controller? Fail Early. Fail Often. Some will say redundancy sucks. I agree, except for where validation is concerned.

Re: [Catalyst] Form validation in insert() and update()?

2007-05-15 Thread mla
::FormValidator. # pass a hash ref or object with param() interface to ne my $form = MLA::Form-new($params); # Validate the data. This terse syntax uses Getopt::Long-style # option specifiers. $form-check('first_name=s'); # required field first_name $form-check('your_email=email'); # required e

Re: [Catalyst] Form validation in insert() and update()?

2007-05-15 Thread mla
Matt S Trout wrote: On Tue, May 15, 2007 at 01:04:42PM -0700, mla wrote: Okay, thanks very much for this. So in terms of the model constraints, you will validate everything twice. Once at the controller layer (where it leverages info from the model), and once in the model itself. So you can

Re: [Catalyst] Re: Persistent login

2007-05-15 Thread mla
[EMAIL PROTECTED] wrote: Evaldas Imbrasas [EMAIL PROTECTED] wrote on 05/15/2007 05:45:11 PM: Persistent login is the one that lasts longer than a session. When a user logs in, she gets an option to be remembered for a given period of time. If this user comes back within that period of time,

[Catalyst] best practices for validation

2007-05-15 Thread mla
I want to summarize some of the thoughts on this thread and see if there's any strong disagreement. o The model should validate its data. o The controller should (directly or indirectly) validate all the form input so you're pretty sure the model(s) can handle it. o Where the model and the

[Catalyst] Form validation in insert() and update()?

2007-05-14 Thread mla
I'm studying different frameworks for a new project. I'm very new to Catalyst and am reading through the tutorial. In part 8, advanced CRUD, there's an example of form validation. The approach is very similar to what I've always used but I've been looking at Rails recently and noticed that they

Re: [Catalyst] Form validation in insert() and update()?

2007-05-14 Thread mla
[EMAIL PROTECTED] wrote: mla [EMAIL PROTECTED] wrote on 05/14/2007 02:45:49 PM: I'm studying different frameworks for a new project. I'm very new to Catalyst and am reading through the tutorial. In part 8, advanced CRUD, there's an example of form validation. The approach is very similar

Re: [Catalyst] Form validation in insert() and update()?

2007-05-14 Thread mla
Dave Rolsky wrote: On Mon, 14 May 2007, mla wrote: Anyone have validation logic in the model and are happy with it? There are two kinds of validation here. One is model-level validation, and yes, it's in my model code. My model throws exceptions, which I trap in the controller and mess

Re: [Catalyst] Form validation in insert() and update()?

2007-05-14 Thread mla
Dave Rolsky wrote: On Mon, 14 May 2007, mla wrote: Could you give an example of how you munge the exceptions into error messages for the user? eval { $user-update( %bunch_of_stuff ); }; if ( my $e = Exception::Class-caught( 'My::App::Exception::DataValidation') ) { # $e

[Catalyst] catalyst tutorial: MyAppDB/Book.pm vs. MyApp/Model/Book.pm

2007-05-14 Thread mla
I just finished getting the tutorial project working. The thing I'm not clear on is this separation between lib/MyAppDB/ and lib/MyApp/Model/ The tutorial says: With Catalyst::Model::DBIC::Schema you essentially end up with two sets of model classes (only one of which you write... the other

Re: [Catalyst] Form validation in insert() and update()?

2007-05-14 Thread mla
Bill Moseley wrote: On Mon, May 14, 2007 at 04:44:41PM -0500, Dave Rolsky wrote: On Mon, 14 May 2007, mla wrote: Anyone have validation logic in the model and are happy with it? There are two kinds of validation here. One is model-level validation, and yes, it's in my model code. My model