<font size=2 face="sans-serif">The Catalyst helper script created most
of the relationships. I added a few at the bottom of the Account.pm file
to since there are a bunch of them based on &quot;account_id&quot;, so
I made them myself and gave them different names. progress, metrics, compliance
are ones I did. the one called &quot;department_id&quot; was created by
the helper and I didn&quot;t want to chang it. I guess I could redefine
it below with a different name. Strangely, the account table has a belongs
to AND a has many to itself based on the account_id field. I am actually
looking to get a list nad that is what I get except for the one field.</font>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td><font size=1 color=#5f5f5f face="sans-serif">From:</font>
<td><font size=1 face="sans-serif">Alexander Hartmaier &lt;alexander.hartmaier@t-systems.at&gt;</font>
<tr valign=top>
<td><font size=1 color=#5f5f5f face="sans-serif">To:</font>
<td><font size=1 face="sans-serif">&lt;catalyst@lists.scsys.co.uk&gt;</font>
<tr valign=top>
<td><font size=1 color=#5f5f5f face="sans-serif">Date:</font>
<td><font size=1 face="sans-serif">05/08/2012 10:35 AM</font>
<tr valign=top>
<td><font size=1 color=#5f5f5f face="sans-serif">Subject:</font>
<td><font size=1 face="sans-serif">Re: [Catalyst] Getting hashref instead
of value</font></table>
<br>
<hr noshade>
<br>
<br>
<br><tt><font size=2>Am 2012-05-08 17:25, schrieb Ari Constancio:<br>
&gt; On Tue, May 8, 2012 at 4:13 PM, Kenneth S Mclane &lt;ksmclane@us.ibm.com&gt;
wrote:<br>
&gt;&gt; My template that cretaes the uri:<br>
&gt;&gt;<br>
&gt;&gt; &lt;td&gt;&lt;a href=&quot;[% c.uri_for('/accountdetails/detail/')
%][% account.account_id<br>
&gt;&gt; %]&quot;&gt;[% account.account_code %]&lt;/a&gt;&lt;/td&gt;<br>
&gt;&gt;<br>
&gt;&gt; If someone could point me in the right direction, Ive been fighting
this for<br>
&gt;&gt; days.<br>
&gt; Hi Kenneth,<br>
&gt;<br>
&gt; I suppose you mean to use<br>
&gt;<br>
&gt; [% c.uri_for('/accountdetails/detail/', account.account_id) %]<br>
&gt;<br>
&gt; instead of<br>
&gt;<br>
&gt; [% c.uri_for('/accountdetails/detail/') %][% account.account_id %]<br>
No he doesn't because he isn't using Chained but Local where the<br>
dispatcher knows nothing about the number of args.<br>
<br>
I assume that you have defined a relationship on the account_id column<br>
without giving it a different name. This makes DBIx::Class inflate the<br>
related row into an object.<br>
Two solutions:<br>
- use a different accessors for your relationships (that's what I'm doing)<br>
- use acount.get_column('account_id') when you can to get the column<br>
value instead of the related row<br>
<br>
Also note that it's a common problem that Template Toolkit calls<br>
everything in list context.<br>
search_rs was added to DBIx::Class to make sure you always get a<br>
resultset object and not a list of row objects.<br>
&gt;<br>
&gt; Regards,<br>
<br>
<br>
*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*<br>
T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien<br>
Handelsgericht Wien, FN 79340b<br>
*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*<br>
Notice: This e-mail contains information that is confidential and may be
privileged.<br>
If you are not the intended recipient, please notify the sender and then<br>
delete this e-mail immediately.<br>
*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*<br>
<br>
_______________________________________________<br>
List: Catalyst@lists.scsys.co.uk<br>
Listinfo: </font></tt><a href="http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst"><tt><font size=2>http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst</font></tt></a><tt><font size=2><br>
Searchable archive: </font></tt><a href="http://www.mail-archive.com/catalyst@lists.scsys.co.uk/"><tt><font size=2>http://www.mail-archive.com/catalyst@lists.scsys.co.uk/</font></tt></a><tt><font size=2><br>
Dev site: </font></tt><a href=http://dev.catalyst.perl.org/><tt><font size=2>http://dev.catalyst.perl.org/</font></tt></a><tt><font size=2><br>
<br>
</font></tt>
<br>
<br>