<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=EN-US link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>You want to do..<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal>$person->affiliation_id-> affiliation_id<span
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<div style='border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt'>
<div>
<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'>
<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> jagdish eashwar
[mailto:jagdish.eashwar@gmail.com] <br>
<b>Sent:</b> Friday, May 01, 2009 11:21 AM<br>
<b>To:</b> The elegant MVC web framework<br>
<b>Subject:</b> Re: [Catalyst] Jason Kohles' tutorial on ExtJs editable data
gridsandCatalyst<o:p></o:p></span></p>
</div>
</div>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal style='margin-bottom:12.0pt'>Thanks, Adam. With the debug
line in the code, for $person->affiliation_id, I get <br>
<br>
[debug] Whats this -
AdventAjaxGrid2::Model::AdventAjaxGrid2DB::Affiliation=HASH(0xad06b00)<br>
[debug] Whats this -
AdventAjaxGrid2::Model::AdventAjaxGrid2DB::Affiliation=HASH(0xad06a60)<br>
[debug] Whats this -
AdventAjaxGrid2::Model::AdventAjaxGrid2DB::Affiliation=HASH(0xacff1e8)<br>
[debug] Whats this - AdventAjaxGrid2::Model::AdventAjaxGrid2DB::Affiliation=HASH(0xacff188)<br>
[debug] Whats this -
AdventAjaxGrid2::Model::AdventAjaxGrid2DB::Affiliation=HASH(0xacff118)<br>
<br>
If I change the debug line to get $person->name, it gives me the
following nicely:<br>
<br>
[debug] Whats this - Jagdish Eashwar<br>
[debug] Whats this - Sushama Marathe<br>
[debug] Whats this - Manasi Jagdish<br>
[debug] Whats this - Ninad Jagdish<br>
[debug] Whats this - Muttsy<br>
<br>
The name column has no belongs_to relationship, but the affiliation_id column
has. That must be making the difference.<br>
<br>
<o:p></o:p></p>
<div>
<p class=MsoNormal>On Fri, May 1, 2009 at 4:16 PM, Adam Witney <<a
href="mailto:awitney@sgul.ac.uk">awitney@sgul.ac.uk</a>> wrote:<o:p></o:p></p>
<div>
<blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;
margin-left:4.8pt;margin-right:0in'>
<p class=MsoNormal><br>
sub people_data : Local {<br>
my ( $self, $c ) = @_;<br>
<br>
my $rs = $c->model( 'AdventAjaxGrid2DB::People' );<br>
my @people = ();<br>
while ( my $person = $rs->next ) {<br>
push( @people, {<br>
id
=> $person->id,<br>
name
=> $person->name,<br>
affiliation_id =>
$person->affiliation_id,<o:p></o:p></p>
</blockquote>
<p class=MsoNormal><o:p> </o:p></p>
</div>
<p class=MsoNormal>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<br>
<br>
$c->log->debug('Whats this -
'.$person->affiliation_id."\n");<br>
<br>
if so then you would have to look at your Model.<br>
<br>
Maybe someone with more experience could tell you the likely reason for this?<o:p></o:p></p>
<div>
<div>
<p class=MsoNormal><br>
<br>
HTH<br>
<br>
adam<br>
<br>
_______________________________________________<br>
List: <a href="mailto:Catalyst@lists.scsys.co.uk" target="_blank">Catalyst@lists.scsys.co.uk</a><br>
Listinfo: <a href="http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst"
target="_blank">http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst</a><br>
Searchable archive: <a
href="http://www.mail-archive.com/catalyst@lists.scsys.co.uk/" target="_blank">http://www.mail-archive.com/catalyst@lists.scsys.co.uk/</a><br>
Dev site: <a href="http://dev.catalyst.perl.org/" target="_blank">http://dev.catalyst.perl.org/</a><o:p></o:p></p>
</div>
</div>
</div>
<p class=MsoNormal><o:p> </o:p></p>
</div>
</div>
</body>
</html>