Re: [Catalyst] Jason Kohles' tutorial on ExtJs editable data gridsandCatalyst

2009-05-01 Thread jagdish eashwar
Hi Adam,

I have these two controllers whose code differs chiefly in respect of the
table being accessed.
The two tables (Affiliation and People) have a reciprocatory 'has_many' /
'belongs_to' relationship. While the affiliation_data sub works, the
people_data sub doesn't. The error message I'm getting for the people_data
sub inclines me to think that the 'allow_blessed' / 'convert_blessed'
features have to be enabled when a table has a 'belongs_to' relationship. I
don't know how to do that.

=head2 people_data

=cut

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

  my $rs = $c-model( 'AdventAjaxGrid2DB::People' );
  my @people = ();
  while ( my $person = $rs-next ) {
  push( @people, {
  id  = $person-id,
  name= $person-name,
  affiliation_id = $person-affiliation_id,
  } );
  }
  $c-stash-{ 'people_stash' } = \...@people;
  $c-detach( $c-view( 'JSON' ) );
  }

=head2 affiliation_data

=cut

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

my $rs = $c-model('AdventAjaxGrid2DB::Affiliation');
my @affiliations = ();
while (my $affiliation  = $rs-next) {
push(@affiliations, {
affiliation_id = $affiliation-affiliation_id,
affiliation_name = $affiliation-affiliation_name
});
}
$c-stash-{'affiliation_stash'} = \...@affiliations;
$c-detach($c-view('JSON'));
}


On Thu, Apr 30, 2009 at 10:04 PM, Adam Witney awit...@sgul.ac.uk wrote:

 The error I get is :
 [error] Caught exception in AdventAjaxGrid2::View::JSON-process
 encountered object
 'AdventAjaxGrid2::Model::AdventAjaxGrid2DB::Affiliation=HASH(0x91b8270)',
 but neither allow_blessed nor convert_blessed settings are enabled at
 /usr/local/share/perl/5.8.8/JSON/Any.pm line 426.

 I couldn't figure out how to enable those settings from the JSON-Any write
 up on CPAN. How is that to be done?


 from my limited experience, this seems to come up when you are not sending
 proper JSON to the JSON view. Check the code before the line:

 $c-detach( $c-view( 'JSON' ) );

 to see what you are sending it (The error suggests you are pushing an
 object to it, in the calendar example he sends a reference to an array of
 hashes).

 HTH

 adam


 ___
 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/


Re: [Catalyst] Jason Kohles' tutorial on ExtJs editable data gridsandCatalyst

2009-05-01 Thread Adam Witney


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

  my $rs = $c-model( 'AdventAjaxGrid2DB::People' );
  my @people = ();
  while ( my $person = $rs-next ) {
  push( @people, {
  id  = $person-id,
  name= $person-name,
  affiliation_id = $person-affiliation_id,


I would guess that this line is returning an Affiliation object rather  
than the affiliation_id then? You could test it by adding this line  
after the push


$c-log-debug('Whats this - '.$person-affiliation_id.\n);

if so then you would have to look at your Model.

Maybe someone with more experience could tell you the likely reason  
for this?


HTH

adam

___
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] fastcgi error

2009-05-01 Thread Jon Schutz

On Fri, 2009-05-01 at 04:14 -0700, gutta wrote:
 hello,
 when i am starting my fastcgi server using perl script/bizmo_fastcgi.pl -l
 /tmp/bizmo.socket -n 5 -p /tmp/bizmo.pid -d i am getting following error
 
 [Fri May 01 09:48:26 2009] [error] [client 122.166.21.34] (2)No such file or
 directory: FastCGI: failed to connect to server /tmp/bizmo.fcgi: connect()
 failed
 [Fri May 01 09:48:26 2009] [error] [client 122.166.21.34] FastCGI:
 incomplete headers (0 bytes) received from server /tmp/bizmo.fcgi
 
 could anyone tell me what is the problem?
 

Looks like you've told apache that your socket is at /tmp/bizmo.fcgi but
you've told the script that it's /tmp/bizmo.socket.


-- 

Jon SchutzMy tech notes http://notes.jschutz.net
Chief Technology Officerhttp://www.youramigo.com
YourAmigo 


___
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] fastcgi error

2009-05-01 Thread Jon Schutz
On Fri, 2009-05-01 at 04:45 -0700, gutta wrote:
 Hi,
 
 I have given the following in my apache config file apache2.conf
 
 FastCgiExternalServer /tmp/bizmo.fcgi -socket
 /var/www/thebizmo/tmp/bizmo.socket
 Alias / /tmp/bizmo.fcgi/
 
 do i need to change the above configurations u mean?

I would think that should read:

FastCgiExternalServer /tmp/bizmo.fcgi -socket /tmp/bizmo.socket


-- 

Jon SchutzMy tech notes http://notes.jschutz.net
Chief Technology Officerhttp://www.youramigo.com
YourAmigo 


___
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] fastcgi error

2009-05-01 Thread Joel Bernstein

On 1 May 2009, at 12:45, gutta wrote:

I have given the following in my apache config file apache2.conf

FastCgiExternalServer /tmp/bizmo.fcgi -socket
/var/www/thebizmo/tmp/bizmo.socket


So you told it that the URI http://yourserver/tmp/bizmo.fcgi should be  
served by proxying the request to the FastCGI socket located at /var/ 
www/thebizmo/tmp/bizmo.socket


And yet perl script/bizmo_fastcgi.pl -l /tmp/bizmo.socket -n 5 -p / 
tmp/bizmo.pid -d tells Catalyst that you want it to listen on a  
socket located at /tmp/bizmo.socket


What do you expect Apache to do in this circumstance? Is /tmp  
symlinked into /var/www/thebizmo/tmp? I don't recommend you to do this  
but I think that is the only way your current configuration would work.


Pick one path and stick to it, you can't just make shit up and expect  
the computer to magically know what you mean.



do i need to change the above configurations u mean?


What do you think the current configuration is meant to do? Unless I'm  
missing something, yes, you need to change the current configuration  
to be consistent about where the FCGI socket is located.


/joel

___
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] fastcgi error

2009-05-01 Thread gutta

Hi,

I have given the following in my apache config file apache2.conf

FastCgiExternalServer /tmp/bizmo.fcgi -socket
/var/www/thebizmo/tmp/bizmo.socket
Alias / /tmp/bizmo.fcgi/

do i need to change the above configurations u mean?

Best Regards,
Mohan


Jon Schutz-3 wrote:
 
 
 On Fri, 2009-05-01 at 04:14 -0700, gutta wrote:
 hello,
 when i am starting my fastcgi server using perl script/bizmo_fastcgi.pl
 -l
 /tmp/bizmo.socket -n 5 -p /tmp/bizmo.pid -d i am getting following error
 
 [Fri May 01 09:48:26 2009] [error] [client 122.166.21.34] (2)No such file
 or
 directory: FastCGI: failed to connect to server /tmp/bizmo.fcgi:
 connect()
 failed
 [Fri May 01 09:48:26 2009] [error] [client 122.166.21.34] FastCGI:
 incomplete headers (0 bytes) received from server /tmp/bizmo.fcgi
 
 could anyone tell me what is the problem?
 
 
 Looks like you've told apache that your socket is at /tmp/bizmo.fcgi but
 you've told the script that it's /tmp/bizmo.socket.
 
 
 -- 
 
 Jon SchutzMy tech notes http://notes.jschutz.net
 Chief Technology Officerhttp://www.youramigo.com
 YourAmigo 
 
 
 ___
 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/
 
 

-- 
View this message in context: 
http://www.nabble.com/fastcgi-error-tp23330068p23331908.html
Sent from the Catalyst Web Framework mailing list archive at Nabble.com.


___
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] fastcgi error

2009-05-01 Thread gutta

Hi Jon,
I have done the changes u suggested.. now its working fine.
Thanks for the reply.
Best Regards,
Mohan

Jon Schutz-3 wrote:
 
 On Fri, 2009-05-01 at 04:45 -0700, gutta wrote:
 Hi,
 
 I have given the following in my apache config file apache2.conf
 
 FastCgiExternalServer /tmp/bizmo.fcgi -socket
 /var/www/thebizmo/tmp/bizmo.socket
 Alias / /tmp/bizmo.fcgi/
 
 do i need to change the above configurations u mean?
 
 I would think that should read:
 
 FastCgiExternalServer /tmp/bizmo.fcgi -socket /tmp/bizmo.socket
 
 
 -- 
 
 Jon SchutzMy tech notes http://notes.jschutz.net
 Chief Technology Officerhttp://www.youramigo.com
 YourAmigo 
 
 
 ___
 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/
 
 

-- 
View this message in context: 
http://www.nabble.com/fastcgi-error-tp23330068p23332364.html
Sent from the Catalyst Web Framework mailing list archive at Nabble.com.


___
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] Unknown error

2009-05-01 Thread Octavian Râşniţă

Hi,

I've tried to install Catalyst::Devel with ActivePerl 5.10.0 under Fedora, 
but I received the warning below.


I read that bug ticket and I've seen that this bug was patched in perl 
5.10.1.


Does this mean that if I will compile Perl 5.10.0 from the tarball, it will 
give the same error?
If yes, is Perl 5.10.1 available somewhere and stable enough for beeing 
recommended to install it?

If no, do you have a better suggestion for solving this issue?

Thank you.

The warning:

### WARNING #
#   #
# You are using perl 5.10.0 with the Unknown error bug. This can make #
# developing Catalyst applications much more painful, as it will come   #
# up with no details every time you have a syntax error in a Controller.#
#   #
# For more information see: #
#   #
#  * http://rt.perl.org/rt3/Public/Bug/Display.html?id=49472#
#   #
# It is highly recommended that you use a different version of perl or  #
# compile a patched version for Catalyst development.   #
#   #
# To skip this check, set the CATALYST_DEVEL_NO_510_CHECK environment   #
# variable. #
#   #
#
Do you want to continue? [no]


___
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] Jason Kohles' tutorial on ExtJs editable data gridsandCatalyst

2009-05-01 Thread jagdish eashwar
Thanks, Adam. With the debug line in the code, for $person-affiliation_id,
I get

[debug] Whats this -
AdventAjaxGrid2::Model::AdventAjaxGrid2DB::Affiliation=HASH(0xad06b00)
[debug] Whats this -
AdventAjaxGrid2::Model::AdventAjaxGrid2DB::Affiliation=HASH(0xad06a60)
[debug] Whats this -
AdventAjaxGrid2::Model::AdventAjaxGrid2DB::Affiliation=HASH(0xacff1e8)
[debug] Whats this -
AdventAjaxGrid2::Model::AdventAjaxGrid2DB::Affiliation=HASH(0xacff188)
[debug] Whats this -
AdventAjaxGrid2::Model::AdventAjaxGrid2DB::Affiliation=HASH(0xacff118)

If I change the debug line to get  $person-name, it gives me the following
nicely:

[debug] Whats this - Jagdish Eashwar
[debug] Whats this - Sushama Marathe
[debug] Whats this - Manasi Jagdish
[debug] Whats this - Ninad Jagdish
[debug] Whats this - Muttsy

The name column has no belongs_to relationship, but the affiliation_id
column has. That must be making the difference.


On Fri, May 1, 2009 at 4:16 PM, Adam Witney awit...@sgul.ac.uk wrote:


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

  my $rs = $c-model( 'AdventAjaxGrid2DB::People' );
  my @people = ();
  while ( my $person = $rs-next ) {
  push( @people, {
  id  = $person-id,
  name= $person-name,
  affiliation_id = $person-affiliation_id,


 I would guess that this line is returning an Affiliation object rather than
 the affiliation_id then? You could test it by adding this line after the
 push

 $c-log-debug('Whats this - '.$person-affiliation_id.\n);

 if so then you would have to look at your Model.

 Maybe someone with more experience could tell you the likely reason for
 this?


 HTH

 adam

 ___
 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/


RE: [Catalyst] Jason Kohles' tutorial on ExtJs editable data gridsandCatalyst

2009-05-01 Thread Scott Pham (scpham)
You want to do..

 

$person-affiliation_id- affiliation_id

 

From: jagdish eashwar [mailto:jagdish.eash...@gmail.com] 
Sent: Friday, May 01, 2009 11:21 AM
To: The elegant MVC web framework
Subject: Re: [Catalyst] Jason Kohles' tutorial on ExtJs editable data
gridsandCatalyst

 

Thanks, Adam. With the debug line in the code, for
$person-affiliation_id, I get 

[debug] Whats this -
AdventAjaxGrid2::Model::AdventAjaxGrid2DB::Affiliation=HASH(0xad06b00)
[debug] Whats this -
AdventAjaxGrid2::Model::AdventAjaxGrid2DB::Affiliation=HASH(0xad06a60)
[debug] Whats this -
AdventAjaxGrid2::Model::AdventAjaxGrid2DB::Affiliation=HASH(0xacff1e8)
[debug] Whats this -
AdventAjaxGrid2::Model::AdventAjaxGrid2DB::Affiliation=HASH(0xacff188)
[debug] Whats this -
AdventAjaxGrid2::Model::AdventAjaxGrid2DB::Affiliation=HASH(0xacff118)

If I change the debug line to get  $person-name, it gives me the
following nicely:

[debug] Whats this - Jagdish Eashwar
[debug] Whats this - Sushama Marathe
[debug] Whats this - Manasi Jagdish
[debug] Whats this - Ninad Jagdish
[debug] Whats this - Muttsy

The name column has no belongs_to relationship, but the affiliation_id
column has. That must be making the difference.



On Fri, May 1, 2009 at 4:16 PM, Adam Witney awit...@sgul.ac.uk wrote:


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

 my $rs = $c-model( 'AdventAjaxGrid2DB::People' );
 my @people = ();
 while ( my $person = $rs-next ) {
 push( @people, {
 id  = $person-id,
 name= $person-name,
 affiliation_id = $person-affiliation_id,

 

I would guess that this line is returning an Affiliation object rather
than the affiliation_id then? You could test it by adding this line
after the push

$c-log-debug('Whats this - '.$person-affiliation_id.\n);

if so then you would have to look at your Model.

Maybe someone with more experience could tell you the likely reason for
this?



HTH

adam

___
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/


Re: [Catalyst] fastcgi error

2009-05-01 Thread Matt S Trout
On Fri, May 01, 2009 at 05:28:14AM -0700, gutta wrote:
 
 Hi Jon,
 I have done the changes u suggested.. now its working fine.

Please use whole words on this mailing list, AOLisms like 'u' are really
annoying.

Additionally, please go to http://lists.scsys.co.uk/ and subscribe properly
rather than using Nabble - they're spammer friendly and I have to block
them on a regular basis.

-- 
Matt S Trout Catalyst and DBIx::Class consultancy with a clue
 Technical Director  and a commit bit: http://shadowcat.co.uk/catalyst/
 Shadowcat Systems Limited
  mst (@) shadowcat.co.ukhttp://shadowcat.co.uk/blog/matt-s-trout/

___
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/