Re: [Catalyst] FormFu edit form problem

2009-05-19 Thread Greg Coates

I'm using HTML::FormFu::Model::DBIC version 0.04002, and this problem is
still there.  Do we know when a patch might be available?

Greg


Moritz Onken wrote:


Am 13.05.2009 um 18:57 schrieb Steve Rippl:

Thanks for the pointer.  I had defined the foreign key relationships 
within MySQL and relied on wsdsis_create.pl model DB DBIC::Schema etc 
etc to build the model and define these relations, but it seems that 
can't be quite be trusted!  Anyway, I'm taking them out of the db and 
manually putting them into the respective models and it's working now.


Thanks again!
Steve


There is a bug in the current version of HTML::FormFu::Model::DBIC which 
might have caused that error message. You might want to try to install 
version 0.04002 or wait until the patched version is avaiable.


moritz

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



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


[Catalyst] HTML::FormFu form elements

2009-02-11 Thread Greg Coates
I've run into a scenario where I need to be able to build an 
HTML::FormFu form and then only display portions of it in my template. 
(So, the typical [% form %] in the template will be replaced by 
something else, at least in my ideal world.)


I tried doing this in the template:
[% form.get_element('name' = 'element_name') %]

I didn't get an error, but it didn't display.

Does anyone know if what I'm trying to do is possible, and if so, how to 
do it?


Thanks,
Greg Coates

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


[Catalyst] Custom fields in a model

2009-01-21 Thread Greg Coates
I have a database table -- let's call it 'Contacts' that I'm accessing 
through a DBIx::Class model.  This table has two fields called 
'first_name' and 'last_name'.


Could I get some suggestion on the best way to add code to the model (or 
the schema) to allow me to add a custom field to the resultset without 
having an actual column in the database table?  I want to be able to 
access a field in the resultset called something like 'common_name'. 
This field would contain a concatenation of the first and last name 
fields for people and only the data from the last name for other 
entities like businesses.


Thanks!

Greg Coates

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


[Catalyst] DBIC Authentication Errors

2008-09-24 Thread Greg Coates
I'm getting errors when I try to login to my web app, which is set up to 
use the DBIC authentication plugin.




Here's the relevant portion of my config file:

authentication:
  default_realm: dbic
  realms:
dbic:
  credential:
class: Password
password_field: usr_password
password_type: clear
  store:
class: DBIx::Class
user_class: BlogDB::Users
id_field: usr_login_name



When I start the dev server, I see this:
[debug] Loaded Config /path/to/my/config/dev.yml
[debug] Setting up auth realm dbic



Here's the login controller:

sub login : Local {
  my ($self, $c) = @_;

  if ($c-request-params-{submitted} eq 'yes') {
my $username = $c-request-params-{usr_login_name} || ;
my $password = $c-request-params-{usr_password} || ;
if ($c-authenticate({ username = $username,
   password = $password })) {
  $c-response-redirect( $c-uri_for('/posts') );
  return;
} else {
  $c-stash-{message} = Invalid user ID or password.;
}
  }

  $c-stash-{template} = 'users/login.tt';
  $c-stash-{stylesheet} = 'form.css';
}


The login form displays fine, but when I try to log in using a 
uid/password combo that IS in the database, I get this error:


[debug] POST request for users/login
[debug] Path is users/login
[error] Caught exception in MyApp::Controller::Users-login User 
retrieval failed: no columns from BlogDB::Users were provided at 
/usr/lib/perl5/site_perl/5.8.5/Catalyst/Authentication/Store/DBIx/Class.pm 
line 63



I've googled for solutions until my fingertips are numb with no luck.  I 
suspect there's some stupid little problem that I'm missing.  Can anyone 
shed some light on this issue for me?


Thanks,
Greg

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


Re: [Catalyst] DBIC Authentication Errors

2008-09-24 Thread Greg Coates

Yep, that fixed it.  I knew it had to be something simple!

Thanks,
Greg

J. Shirley wrote:

On Wed, Sep 24, 2008 at 2:52 PM, Greg Coates [EMAIL PROTECTED] wrote:

I'm getting errors when I try to login to my web app, which is set up to use
the DBIC authentication plugin.



Here's the relevant portion of my config file:

authentication:
 default_realm: dbic
 realms:
   dbic:
 credential:
   class: Password
   password_field: usr_password
   password_type: clear
 store:
   class: DBIx::Class
   user_class: BlogDB::Users
   id_field: usr_login_name



When I start the dev server, I see this:
[debug] Loaded Config /path/to/my/config/dev.yml
[debug] Setting up auth realm dbic



Here's the login controller:

sub login : Local {
 my ($self, $c) = @_;

 if ($c-request-params-{submitted} eq 'yes') {
   my $username = $c-request-params-{usr_login_name} || ;
   my $password = $c-request-params-{usr_password} || ;
   if ($c-authenticate({ username = $username,
  password = $password })) {
 $c-response-redirect( $c-uri_for('/posts') );
 return;
   } else {
 $c-stash-{message} = Invalid user ID or password.;
   }
 }

 $c-stash-{template} = 'users/login.tt';
 $c-stash-{stylesheet} = 'form.css';
}


The login form displays fine, but when I try to log in using a uid/password
combo that IS in the database, I get this error:

[debug] POST request for users/login
[debug] Path is users/login
[error] Caught exception in MyApp::Controller::Users-login User retrieval
failed: no columns from BlogDB::Users were provided at
/usr/lib/perl5/site_perl/5.8.5/Catalyst/Authentication/Store/DBIx/Class.pm
line 63


I've googled for solutions until my fingertips are numb with no luck.  I
suspect there's some stupid little problem that I'm missing.  Can anyone
shed some light on this issue for me?

Thanks,
Greg



You probably want $c-authenticate({ usr_login_name = $username,
usr_password = $password });

The parameters passed into authenticate match what your DBIC schema
class declares.

-J

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


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