Re: [Catalyst] The model -is- where your business logic lives.

2007-09-28 Thread Ian Docherty
Matt S Trout wrote: Put this code in MyApp::Schema::Demo. I often call it e.g. MyApp::DataStore or MyApp::Domain to remind me that it's the business layer and the DBIC-ness is merely incidental. sub do_some_business_logic_stuff { my ($self) = @_; if () { $self->state('pending

Re: [Catalyst] The model -is- where your business logic lives.

2007-09-27 Thread Ian Docherty
Ian Docherty wrote: I don't see how this helps me with the namespace in Catalyst, if I use $c->model('DBIC::Demo') won't it still come back with the namespace MyApp::Model::DBIC::Demo? my bad: Stupid of me to think it matters. That's wh

Re: [Catalyst] The model -is- where your business logic lives.

2007-09-27 Thread Ian Docherty
Pedro Melo wrote: That's what I do with two minor adjustements: * I started using load_namespaces to control each source resultset class also; * I don't put my model inside the catalyst application. And is load_namespaces significantly slower than using load_classes with all classes expli

Re: [Catalyst] The model -is- where your business logic lives.

2007-09-27 Thread Ian Docherty
Pedro Melo wrote: [...] That's what I do with two minor adjustements: * I started using load_namespaces to control each source resultset class also; * I don't put my model inside the catalyst application. It seems to me that if I want to use the business logic in an external application (c

[Catalyst] The model -is- where your business logic lives.

2007-09-27 Thread Ian Docherty
In a previous thread, Matt S Trout said. The model -is- where your business logic lives. The real question is whether your ORM should be directly in the model or not, but that's a whole different thread. Based on this I have the following simple code. package MyApp::Model::DBIC; use st

Re: [Catalyst] flash - Duplicate entries

2007-09-25 Thread Ian Docherty
Tobias Kremer wrote: After deploying our new Catalyst application I'm receiving this error quite often per day: "DBIx::Class::ResultSet::find_or_create(): DBI Exception: DBD::mysql::st execute failed: Duplicate entry 'flash:9b11b5354715b56c9395abdf21544e83db5b0814' for key 1 [...] at /usr/local/

Re: [Catalyst] Some guidance needed please

2007-09-13 Thread Ian Docherty
Simon Wilcox wrote: Will Hawes wrote: Whoops, my bad. $c->model() does indeed return a DBIx::Class::ResultSet, so you would need to retrieve/create an instance of your UsedPassword class from the resultset in order to call any methods on it: my $used_password = $c->model('DBIC::UsedPasswor

Re: [Catalyst] Some guidance needed please

2007-09-13 Thread Ian Docherty
My application has (effectively, subject to some cut and paste) the following. package MyApp::Schema; use strict; use warning; use base qw(DBIx::Class::Schema); __PACKAGE__->load_classes(qw( UsedPassword )); 1; package MyApp::Schema::UsedPassword; use

Re: [Catalyst] Some guidance needed please

2007-09-13 Thread Ian Docherty
Will Hawes wrote: ... Isn't this just a case of adding a create_limited() method to your model class? package MyApp::Schema::UsedPassword; ... sub create_limited { my( $self, $user, $password ) = @_; # password checking logic here } In your controller: $c->model('DBIC::UsedPassword')->c

Re: [Catalyst] Some guidance needed please

2007-09-13 Thread Ian Docherty
logic into a business logic layer? In which case how would I obtain a $schema object? Would I have to then pass this as a parameter to the method? Regards Ian Ian Docherty wrote: Hi My existing Catalyst application is being extended. I want to keep a record of previous passwords used by a

[Catalyst] Some guidance needed please

2007-09-13 Thread Ian Docherty
Hi My existing Catalyst application is being extended. I want to keep a record of previous passwords used by a user to prevent them being re-used. I have Model 'UsedPassword' to keep track of the previous 8 (say) passwords as so- package MyApp::Schema::UsedPassword; use strict; use base qw(

Re: [Catalyst] t directory hierarchy

2007-08-16 Thread Ian Docherty
Jason Kohles wrote: On Aug 15, 2007, at 11:43 AM, Matt S Trout wrote: 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

[Catalyst] t directory hierarchy

2007-08-15 Thread Ian Docherty
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 fo

Re: [Catalyst] Using Workflow with Catalyst (was Making Controllers thin and Models thick)

2007-07-24 Thread Ian Docherty
John Napiorkowski wrote: - ... It's an awful horrible piece of shit. Class::Workflow was written by our very own Yuvla Kogman to replace it and works very nicely with Catalyst. Matt, I'd appreciate when you have a little time if you could share some more detailed thoughts on this, since

Re: [Catalyst] Using Workflow with Catalyst (was Making Controllers thin and Models thick)

2007-07-24 Thread Ian Docherty
Catalyst, is there somewhere else where further discussion of Class::Workflow can be taken? Regards Ian Matt S Trout wrote: On Tue, Jul 24, 2007 at 02:43:12PM +0100, Ian Docherty wrote: Thanks for pointing out the workflow CPAN module. I am very interested in this for my current project and

[Catalyst] Using Workflow with Catalyst (was Making Controllers thin and Models thick)

2007-07-24 Thread Ian Docherty
Thanks for pointing out the workflow CPAN module. I am very interested in this for my current project and must spend some time looking at it. Has anyone actually used workflow within a Catalyst application and can they give the list their opinion and experiences with it? Regards Ian Docherty

Re: [Catalyst] Deployment of many Catalyst sites on the same machine

2007-05-15 Thread Ian Docherty
ltiple instances of the same application? MyApp => 'first.example.com' MyApp => 'second.example.com' I presume there would be no choice in this case but to use an fcgi handler for each one and mod-perl can't be used at all in this case? Regards Ian Docherty

[Catalyst] Developers needed for two Catalyst projects

2007-04-24 Thread Ian Docherty
are interested and have this experience please contact me directly at *ian dot docherty at horivert dot co dot uk* with a brief resume of your experience and your hourly rate. I look forward to talking to you Regards Ian Docherty ___ List: Catalyst

[Catalyst] Team needed for Catalyst project work in Eastern Europe?

2007-04-19 Thread Ian Docherty
We are looking for a small team of Catalyst programmers, based in Eastern Europe, who may be interested in a project. The project is to replace an existing PHP/MySql transaction processing web application with a new application written in Catalyst/DBIC Some analysis of the current application

Re: [Catalyst] Read and Display from i/o file

2007-04-10 Thread Ian Docherty
Will First you need to put the data you read into an array (for example @rows) then put it on the stash The main problem is that your template [% FOREACH row IN row %] should be [% FOREACH row IN rows %] I think this is your main problem. Regards Ian C. Docherty (icydee) Will Smith wrote

Re: [Catalyst] basic CRUD confusion

2007-03-31 Thread Ian Docherty
Jack Lauritsen wrote: Hello, I am building a (test only) site based modifying the classes in the catalyst tutorial, and have a hopefully simple question. I have a search box that takes an isbn number, and then build a book with the data from amazon web services. The problem comes when I want to

Re: [Catalyst] fastcgi configuration problems

2007-03-24 Thread Ian Docherty
Wade Thanks for that advise, I will certainly do so. However I was only following the tutorials and installation instructions so perhaps they should be updated as well. Regards Ian C Docherty (icydee) [EMAIL PROTECTED] wrote: rahed <[EMAIL PROTECTED]> wrote on 03/23/2007 10:27:04 AM:

Re: [Catalyst] fastcgi configuration problems

2007-03-23 Thread Ian Docherty
Brian. Excellent, that was it exactly (amazing what difference a single '/' can make!) (That puts pressure on me to recipricate and to update C-P-I18N-DBIC to help you now! I will see what I can do) Regards Ian Brian Cassidy wrote: Ian Docherty wrote: FastCgiExternalS

[Catalyst] fastcgi configuration problems

2007-03-23 Thread Ian Docherty
I can only see my Catalyst home page using fastcgi, all other pages report a '404 not found'. I have been using Catalyst for about a year using Apache mod-perl or the build-in catalyst server. I now need to run more than one instance of an application on a server. I understand I can do this

Re: [Catalyst] html escaping question

2007-03-21 Thread Ian Docherty
Mario I might have the wrong end of the stick here but I hope you are saying that you are going to fix this by making sure that the database holds the un-escaped text? Regards Ian C Docherty (icydee) Mario Minati wrote: Am Mittwoch 21 März 2007 15:01 schrieb Carl Franks: You were r

Re: [Catalyst] html escaping question

2007-03-21 Thread Ian Docherty
Mario Minati wrote: I am Carl. But how can I circumvent this. Actually it's not a clever question. Is it usefull to circumvent that. My current problem: As the part of my project I am working on at moment deals with companies I have to deal with "GmbH & Co. KG" which is a quite popular type

Re: [Catalyst] Sharing session and login data

2007-02-28 Thread Ian Docherty
I might be asking the blindingly obvious, but do the two applications use the same domain? If not sessions will not work between them because the session ID is normally stored in a cookie which cannot be passed between domains. You may have to pass the cookie in the URL in that case. Regards

Re: [Catalyst] Re: looping

2007-02-14 Thread Ian Docherty
A. Pagaltzis wrote: * Will Smith <[EMAIL PROTECTED]> [2007-02-12 21:25]: my $column = $c->model("myDB::Author")->get_column('last_name'); while(my $name = $column->next){ $lname[$i] = $name; $i = $i + 1; } Ugh. Use `push`; this isn’t C. Regards, Or 'map' _

[Catalyst] DRY REST

2007-02-05 Thread Ian Docherty
I would welcome some advise on how to organise this. I have several places where I want to create a 'person', by which I mean enter firstname, lastname, birthdate etc. for a person. Now a 'person' can be a sender, a beneficiary, a user, an agent etc. and using inheritance 'person' is a base

Re: [Catalyst] Recommend methods for form handling

2007-01-18 Thread Ian Docherty
ort? I use Catalyst::Plugin::I18N::DBIC (shameless plug) I don't use FormBuilder, I 'roll my own' html which gives me more control. Regards Ian Docherty (IcyDee) ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/

Re: [Catalyst] Recommend methods for form handling

2007-01-18 Thread Ian Docherty
The only issue I had was with checkboxes filled in from the database, since CGI does not send back a value for unchecked checkboxes then FillInForm would not handle them correctly so I had to develop a work-around. Regards Ian Docherty (IcyDee) Oh, amazing! I was just starting to write a

Re: [Catalyst] Recommend methods for form handling

2007-01-17 Thread Ian Docherty
m is re-submitted. It makes my controllers so much simpler. Regards Ian Docherty (IcyDee) ___ 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] Recommend methods for form handling

2007-01-17 Thread Ian Docherty
. Regards Ian Docherty (IcyDee) ___ 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] Browser window/tab independent sessions

2007-01-09 Thread Ian Docherty
Perrin Harkins wrote: Ian Docherty wrote: What is still not clear is how to generate (for all possible ways of opening a new window) a new URL encoded session value. e.g. cutting and pasting a URL from one window into another will also copy the URL encoded session so both windows would have

Re: [Catalyst] number of users

2007-01-09 Thread Ian Docherty
think you could use is how many 'live' sessions are there and for this you would have to look at your session store. With Session::Store::File it uses |Cache::FileCache and I can't see any direct way of reading how many sessions are still active. You would have to look at the cod

Re: [Catalyst] Browser window/tab independent sessions

2007-01-09 Thread Ian Docherty
Matija Grabnar wrote: Octavian Rasnita wrote: And I think this is what is wanted, because I can't see other needs for having 2 separate sessions on the same computer. There is no need for having two separate sessions if you can guarantee the user will ALWAYS be able to finish one task before

Re: [Catalyst] Browser window/tab independent sessions

2007-01-08 Thread Ian Docherty
Octavian Rasnita wrote: Hi, Maybe I didn't understand well the question, but if the user wants to create a session that works only in a certain window, but doesn't work in the other windows, a simple cookie can be used if its expiry date is set to 0. This way the cookie won't be saved, but

Re: [Catalyst] Browser window/tab independent sessions

2007-01-08 Thread Ian Docherty
e URI parameter (different for all windows/tabs). I still don't know how to ensure each new window/tab gets it's own unique session in the URI however? Regards Ian Docherty (IcyDee) ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawm

[Catalyst] Browser window/tab independent sessions

2007-01-05 Thread Ian Docherty
d a new window with a unique window_session? I can't be the first person to try this, what have other people done? Regards Ian Docherty (IcyDee) ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalys

Re: [Catalyst] using 'config' in a partpath

2006-12-22 Thread Ian Docherty
Ash Berlin wrote: By using PathPart instead ;) Ouch. I even looked at your answer for a while before realizing there was a difference between PathPart and PartPath =-O Thanks greatly. That (and Robert 'phaylon' Sedlacek's answer) put me back on the correct path. Regards Ian _

[Catalyst] using 'config' in a partpath

2006-12-21 Thread Ian Docherty
if I want a URI like /config/34/display Then I can create a PartPath similar to:- package MyApp::Controller::Config; use strict; use warnings; use base 'Catalyst::Controller'; sub Config : PartPath('/config') Chained('/') CaptureArgs(1) { my ($self, $c, $config_id) = @_; # do something

Re: [Catalyst] Coverage tests in Catalyst

2006-12-05 Thread Ian Docherty
s to the application will probably be the bulk of the tests for a big application and these will not be caught by the first method but will by the second. I suppose I am asking if both these can be combined to give total coverage from the two techniques. Jonathan Rockway wrote: Ian Docherty wrote:

[Catalyst] Coverage tests in Catalyst

2006-12-05 Thread Ian Docherty
Is it possible to do coverage tests in a Catalyst application? If so how? I can't find any references that help. ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archi

Re: [Catalyst] Cannot create a cache

2006-11-17 Thread Ian Docherty
Perrin Harkins wrote: Ian Docherty wrote: I have a hash which is acting as my cache but even if I put values into it, on the next request the hash is empty. Are you aware that apache runs multiple processes and that each process has a different copy of your %cache variable? You will not

[Catalyst] Cannot create a cache

2006-11-16 Thread Ian Docherty
I am trying to implement a cache with a Catalyst app running under Apache2 mod-perl and as far as I can tell the cache is clear at the start of each request. I have a hash which is acting as my cache but even if I put values into it, on the next request the hash is empty. Have I configured m

Re: [Catalyst] Announce. Catalyst::Plugin::I18N::DBIC 0.01

2006-11-15 Thread Ian Docherty
Daniel We are still at an early stage in terms of learning how to provide i18n and I produced this module as much as a 'proof of concept' as anything else. I would be very interested in discussing what you have been doing but it may be best to move the discussion out of this forum unless it is

Re: [Catalyst] Announce. Catalyst::Plugin::I18N::DBIC 0.01

2006-11-15 Thread Ian Docherty
Ian Docherty wrote: Brandon. Thanks for the feedback. see below. Brandon Black wrote: snip... I've just been looking at Cat I18N stuff. This looks promising (I haven't actually used it yet). Based on the source, I would make a few suggestions for the next version: 1) Make the

Re: [Catalyst] Announce. Catalyst::Plugin::I18N::DBIC 0.01

2006-11-14 Thread Ian Docherty
Brandon. Thanks for the feedback. see below. Brandon Black wrote: snip... I've just been looking at Cat I18N stuff. This looks promising (I haven't actually used it yet). Based on the source, I would make a few suggestions for the next version: 1) Make the model name "DBIC::Lexicon" configur

Re: [Catalyst] IDE/editor

2006-11-14 Thread Ian Docherty
Have you looked at UltraEdit for Windows (unfortunately no version for Linux) http://www.ultraedit.com/ I think it gives you everything you listed and more. Regards Ian Docherty Christopher H. Laco wrote: Max Afonov wrote: Now the funny part is that you did NOT recommend

Re: [Catalyst] Announce. Catalyst::Plugin::I18N::DBIC 0.01

2006-11-13 Thread Ian Docherty
John I finally worked out what I was doing wrong in my upload to CPAN. It should be on the mirrors soon, but if you want a version prior to that or information on how to use it send me a personal email. Regards Ian John Napiorkowski wrote: I'll be using it in this application I wrote that stor

[Catalyst] Announce. Catalyst::Plugin::I18N::DBIC 0.01

2006-11-13 Thread Ian Docherty
Since I got no response to my request a few weeks ago about I18N data from a database I wrote my own :) This module has just been released to CPAN. It builds on Catalyst::Plugin::I18N and inherits all methods from that module. In addition it provides a 'load_lexicon' method that loads data fr

Re: [Catalyst] automatic form generation based on data models

2006-11-09 Thread Ian Docherty
Josef Karthauser wrote: On Wed, Nov 08, 2006 at 10:29:11PM +0100, Zbigniew Lukasiak wrote: ... I agree. I'm a week (part time) into building my application with Cayalyst, and I'm still not anywhere near the functionality I had with Maypole after a day of hacking. This isn't because maypole

Re: [Catalyst] automatic form generation based on data models

2006-11-08 Thread Ian Docherty
marcus baker wrote: In a primarily Perl shop I've joined, Django has become all the rage. Everyone into it is amazed at the templating capabilities and the database abstraction layer (...they obviously hadn't really done much with the Template Toolkit, or even heard of Class::DBI or DBIx::Class).

[Catalyst] Ideas on localisation

2006-11-06 Thread Ian Docherty
I have been investigation options for localisation and it occurs to me to use something like Catalyst::Plugin::I18N My understanding of this package is that you create a language package for each language you want to support. e.g. MyApp::I18N::de MyApp::I18N::fr etc. However, this seems to l

Re: [Catalyst] Where should constraints go

2006-11-06 Thread Ian Docherty
Laurent Thank you for that information. I will certainly look at Data::Domain in some detail. I don't know if I will move over to it since I have already invested a lot of time and effort into using Data::FormValidator but I will certainly look at it for my next project. :) Regards Ian C. Doc

[Catalyst] Localization (was - Where should constraints go)

2006-11-04 Thread Ian Docherty
John Siracusa wrote: ...cut... Warning! Localization alert! :) Like I said before, I don't think you really want to be passing things to the view at that granularity. It makes for some vary hairy form templates--one for each locale, to boot. If you whip up all this stuff *before* passing it o

Re: [Catalyst] Where should constraints go

2006-11-03 Thread Ian Docherty
Matt S Trout wrote: Ian Docherty wrote: My problem is finding a clean way of getting these constraints out of the Model and into the View so that I can generate meaningful error messages without hard-coding them in the templates. By 'clean' I mean not having to code the Controller

Re: [Catalyst] Where should constraints go

2006-11-03 Thread Ian Docherty
Brian Kirkbride wrote: ... This is the approach I have taken in the past, although I hadn't included any metadata (ie [1,16]) with the error_id. This fits into separation of business and presentation logic nicely because the model is free to return an error that has some semantic meaning "PAS

Re: [Catalyst] Where should constraints go

2006-11-03 Thread Ian Docherty
Yes this pretty much agrees with my interpretation. It is not so much the location of the constraint rules as how to propagate them to the view (i.e the stash) John Siracusa wrote: Keep in mind that there are at least three possible levels of constraints in a database-backed web app. 1. Const

Re: [Catalyst] Where should constraints go

2006-11-03 Thread Ian Docherty
Carl Franks wrote: I made on very basic start [1] on being able to automatically create constraints from the database column types. At the moment it only supports mysql, and it's also probably very out-of-sync with the current svn trunk - but I'd /really/ like to see it finished, and I /really/

[Catalyst] Where should constraints go

2006-11-03 Thread Ian Docherty
Where should the various constraint values go in my MVC structure? For example the Model defines the size of each field in (for example) a username field in the User database table as being 16 characters max. I am using FormValidator to validate the username field by calling a validation routi