Re: [Catalyst] how to do persistent session data (aka shopping cart) in catalyst?

2018-04-26 Thread Hernan Lopes
Dear Fernan Aguero, On Thu, Apr 26, 2018 at 11:31 AM, Fernan Aguero wrote: > Hello, > > what is the current recommended way of developing a persistent > shopping-cart-style functionality in a catalyst app? > > We would like to be able to support the following: > i) store session data in the serv

Re: [Catalyst] automatically updating a join table

2014-06-05 Thread Hernan Lopes
pace \ 'dbi:Pg:dbname=your_database_name' \ myuser \ mypassword 2. create a script.pl that will use the generated schema: use lib ( "./lib" ); use DBSchema; medico my $schema = DBSchema->connect('dbi:Pg:dbname=your_database_name', 'hernan&#

Re: [Catalyst] Subject: Simple question: setting pre-set fields/creation actions in Catalyst::Controller::DBIC::API::REST

2014-06-05 Thread Hernan Lopes
ou should get that working and understood before you can proceed. Check if you are receiving some content in the correct controller. Try do Dump the contents of $c->req and make sure you are getting the correct contents with the respective content types. cheers, Hernan Lopes On Thu, Jun 5, 20

Re: [Catalyst] Re: New design

2013-07-24 Thread Hernan Lopes
its because catalyst can do everything, including dance. And its solid like a brick. And cpan is the universe that has all the things. []'s Hernan On 7/24/13, Lance A. Brown wrote: > David Dorward said the following on 7/23/2013 7:30 PM: >> Then we come to Man With A Brick. Putting the first br

Re: [Catalyst] New design

2013-07-23 Thread Hernan Lopes
Good good On 7/23/13, Mark Keating wrote: > The nice chaps at Evozon have recently been making design mocks for a > bunch of Perl sites and they have come up with a fresh look for > Catalyst. Take a look and let me know what you guys think. > > http://www.mdk.me.uk/community/mocks/Catalyst.jpg >

Re: [Catalyst] How to avoid repeating methods in controllers ?

2013-07-21 Thread Hernan Lopes
you might want something like this, where one class defines common attributes, and other classes extend it, for example package CommonAttributes; use Moose; has name => ( is => 'rw', ); sub jump { my ( $self, $c ) = @_; warn "JUMP"; } 1; package ControllerOne; use Moose; extends q

Re: [Catalyst] FormFu: How to ensure a field value is unique?

2013-06-03 Thread Hernan Lopes
There is only one way.. you must check if that id exists wherever you are saving it... and you can verify in many ways... ie. ajax, or on form submit. In your case, follow the formhandler docs and you will find a section where it validates the form... in that point, you can show the error to your u

Re: [Catalyst] catalyst and dojo, ajax come from?

2013-05-04 Thread Hernan Lopes
Ajax means: Asynchronous Javascript and XML That means you must have some sort of client, that usualy is the web browser (toghether with your dojo). And, that browser makes ajax calls to the web services... and those webservices could be catalyst, with tt, or whatever you want. So the true functi

Re: [Catalyst] Datagrid with details view?

2012-04-05 Thread Hernan Lopes
Kenneth, you are using ->search which return multiple records, and you are using [% details.account_code %] on your code. Maybe you should: 1. [% details.0.account_code %] and ->all or 2. while ( $item = $results->next ) { ... } and you can always do $results = $c->model('ORANGES::AccountDetails'

Re: [Catalyst] moniker_map arg in app_create.pl

2011-05-04 Thread Hernan Lopes
you should name your model singular, not plural On Wed, May 4, 2011 at 1:31 PM, matthew couchman (JIC) < matthew.couch...@bbsrc.ac.uk> wrote: > Hi, > > > > I have a table called plant_species which by default creates a schema > result class PlantSpecy when I run my app_create.pl script. To get ar

Re: [Catalyst] Caching SQL results for speed...?

2011-04-14 Thread Hernan Lopes
i remember you mentioned something about many to many select options, try disabling those.. and then does the form works faster? if so, then the problem is mostly like in there ... try populating your options manually On Thu, Apr 14, 2011 at 1:15 PM, will trillich wrote: > On Wed, Apr 13, 2011 at

Re: [Catalyst] Force the session to be saved.

2011-03-29 Thread Hernan Lopes
if your problem is delay javascript, or start script after any amount of seconds try: setTimeout( 'alertme();' , 1500 ); function alertme () { alert(' time is up! '); } --Hernan On Tue, Mar 29, 2011 at 2:46 PM, Duncan Garland < duncan.garl...@motortrak.com> wrote: > Hi, > > > > We’ve been

Re: [Catalyst] Catalyst under Plack (PSGI)

2011-02-21 Thread Hernan Lopes
to configure your logs on catalyst and psgi, create your myapp/script/my_app.psgi correctly and tell it where to log, like this #!/usr/bin/env perl use strict; use warnings; use lib ( "./lib" ); use MyApp; use Catalyst::Engine::PSGI; use FCGI::ProcManager; use Plack::Builder; use Plack::Middlewar

Re: [Catalyst] Authentication not working as expected

2011-01-11 Thread Hernan Lopes
imple CRUD with user and role data, >> and uses authentication to prevent users updating other user's data. >> I have a working application that allows one to create and read user data, >> but I can't figure out how to apply the authentication. The book says: >> &quo

Re: [Catalyst] Authentication not working as expected

2011-01-11 Thread Hernan Lopes
I dont know about the book, but this manual sure works and my opinion is its better than any book, (find the authorization/authentication and compare what you missed) the url should be http://search.cpan.org/~zarquon/Catalyst-Manual-5.8005/lib/Catalyst/Manual/Tutorial/01_Intro.pod att, Hernan

Re: [Catalyst] Roles and Permissions -- Controller vs View

2010-12-28 Thread Hernan Lopes
try something like this... which is basically 1. verify the roles on the controller 2. build a data structure of displayed content based on roles and set to stash 3. let the view processes whats in the stash without checking for any roles in the end its 1 controler and 1 view Controller: sub ren

Re: [Catalyst] receiving form-elements in sequence...?

2010-12-27 Thread Hernan Lopes
Thats not how you do it. you should use javascript to create a hash, or array of IDs and positions and then post that to your server. On Mon, Dec 27, 2010 at 2:51 PM, will trillich wrote: > Quick question: how do we determine the sequence of submitted form > elements? > > Background: we've got se

Re: [Catalyst] DBIx::Class - table relations and joins

2010-12-14 Thread Hernan Lopes
Thats DBIx::Class question and not a catalyst question. here are dbix class docs: http://search.cpan.org/~frew/DBIx-Class-0.08124/everything you need is there. Take a look at joining at the bottom of the page. --Hernan On Tue, Dec 14, 2010 at 1:27 PM, Vivek Chhikara wrote: > > > I am new to cat

Re: [Catalyst] Transferring control via root/auto

2010-12-07 Thread Hernan Lopes
your redirect will make "auto" be executed again and redirecting again to loginedit On Tue, Dec 7, 2010 at 1:53 PM, Thompson wrote: > Here is my problem, > > If a user logs in for the 1st time I want to force them to change their > password. I have a specific action in my Users controller to ha

Re: [Catalyst] FormHandler -- pro or con?

2010-12-07 Thread Hernan Lopes
Of course you can load a fields config from a file, db or wathever here is a simple form example of formhandler with perl catalyst: in your User.pm controller: use HTML::FormHandler; sub fields { return [ display0 => { type => 'Display', html => 'Personal data',

Re: [Catalyst] FormHandler -- pro or con?

2010-11-30 Thread Hernan Lopes
Formhandler works like a charm, does many useful checks and you wont have any trouble with it. i have been using it for a while without any problem. As for the memory leaks, it can affect you when resources are limited or when you are running out of ram. (no idea if there are any leaks on formhandl

Re: [Catalyst] Re: superuser "switch-user" session function?

2010-11-30 Thread Hernan Lopes
Indeed, i think it should login as a new user not changing the actual session. maybe something like: admin clicks "login as joeuser">open a new browser window as admin>verify its admin and re-login as a new user. register on session user is admin so he can log back in. Then add button "terminate s

Re: [Catalyst] Which Form Validation Libs?

2010-11-30 Thread Hernan Lopes
formhandler and formbuilder have some syntax similarities. shouldnt be hard to move from one to the other. Just in case you are curiousm, here are some examples: FormBuilder: http://www.formbuilder.org/tutor/index.pl?c=1&s=5 FormHandler: http://search.cpan.org/~gshank/HTML-FormHandler-0.32005/lib/H

Re: [Catalyst] Overriding Catalyst::View::TT WRAPPER

2010-11-29 Thread Hernan Lopes
I personally think that [% IF no_wrapper %] etc is not clean enough so i would create a new view and call it View::NoWrapper then you can set $c->stash( current_view => 'NoWrapper', template => 'src/mypage.html', ); and then, you will need to set a wrapper.tt. But you can choose to leave it with [

Re: [Catalyst] Catalyst::Authentication::Credential::OAuth

2010-11-23 Thread Hernan Lopes
To integrate facebook login onto your site, Have you tried Catalyst::Authentication::Credential::FBConnect ? It works and lets you access users facebook id from $c->user->session_uid as documented 1. You need to register under http://developers.facebook.com and register a new application. You must

Re: [Catalyst] Re: Trying out FormHandler, running into "maketext" error

2010-11-22 Thread Hernan Lopes
ed => 0, ) i bet your error will go away On Mon, Nov 22, 2010 at 12:19 PM, will trillich wrote: > Our form-class includes > has_field 'submit' => ( widget => 'submit' ) > > Do you mean type=>'submit' instead of widget=>'sub

Re: [Catalyst] Re: Trying out FormHandler, running into "maketext" error

2010-11-22 Thread Hernan Lopes
will trilich, are you using widget type submit ? try to replace with type => 'Submit' Hernan Lopes On Mon, Nov 22, 2010 at 1:38 AM, John Anderson wrote: > > On Nov 21, 2010, at 10:26 PM, will trillich wrote: > > > Pooh. Still no luck. When we try a more more

Re: [Catalyst] error handling (Chain where ajax and non-ajax actionschain off)

2010-11-10 Thread Hernan Lopes
Octavian, Its just an action with attributes predefie ie: (in your controller): __PACKAGE__->config( action => { myaction => { Chained => 'base', PathPart => q{myaction}, Args => 0, }, }); sub myaction :Action { my ( $self, $c,) => @_; ..

Re: [Catalyst] Trouble using Catalyst::Controller::FormBuilder

2010-11-10 Thread Hernan Lopes
indeed, again: here is a simple form example of formhandler with perl catalyst: in your User.pm controller: use HTML::FormHandler; sub fields { return [ display0 => { type => 'Display', html => 'Personal data', }, name => { type

Re: [Catalyst] Catalyst with HTML::FormHandler

2010-11-05 Thread Hernan Lopes
here is a simple form example of formhandler with perl catalyst: in your User.pm controller: use HTML::FormHandler; sub fields { return [ display0 => { type => 'Display', html => 'Personal data', }, name => { type =>

Re: [Catalyst] Accessing DB from external model

2010-11-05 Thread Hernan Lopes
Mike, also, if you havent already, take a look on Catalyst::Tutorial , in my opinion its by far the best documentation to begin with catalyst. http://search.cpan.org/~zarquon/Catalyst-Manual-5.8005/lib/Catalyst/Manual/Tutorial/01_Intro.pod On 11/5/10, Mike Raynham wrote: > On 05/11/10 10:10,

Re: [Catalyst] C::P::Redirect

2010-11-03 Thread Hernan Lopes
Hey Jon, In perl catalyst apps you can set a proper response status for your redirect as simple as: ie. $c->res->redirect( '/foo/bar.html', 301 ); Read more at: http://search.cpan.org/~bobtfish/Catalyst-Runtime-5.80029/lib/Catalyst/Response.pm#$res-%3Eredirect%28_$url,_$status_%29 -Hernan On

Re: [Catalyst] best practices for handling forms?

2010-09-20 Thread Hernan Lopes
=> ' Your Personal Data foo bar baz ' ); On Mon, Sep 20, 2010 at 8:09 PM, Hernan Lopes wrote: > perl Catalyst Forms with Formhandler and Thickbox: > > You know you dont always need a template.tt2 file... this is useful with > ajax (especially with thickbo

Re: [Catalyst] best practices for handling forms?

2010-09-20 Thread Hernan Lopes
correction: you can pass a reference to $c->stash(template => \'foobas'), so you end up with: $c->stash( template => \$form->render, current_view => 'Ajax', ); On Mon, Sep 20, 2010 at 8:09 PM, Hernan Lopes wrote: > perl Catalyst Forms with Formhandler a

Re: [Catalyst] best practices for handling forms?

2010-09-20 Thread Hernan Lopes
perl Catalyst Forms with Formhandler and Thickbox: You know you dont always need a template.tt2 file... this is useful with ajax (especially with thickbox) so you can pass a scalar as template, so you end up with: $c->stash( template => $form->render, current_view => 'Ajax', ); 1. You could creat