<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 "account_id", so
I made them myself and gave them different names. progress, metrics, compliance
are ones I did. the one called "department_id" was created by
the helper and I didn"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 <alexander.hartmaier@t-systems.at></font>
<tr valign=top>
<td><font size=1 color=#5f5f5f face="sans-serif">To:</font>
<td><font size=1 face="sans-serif"><catalyst@lists.scsys.co.uk></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>
> On Tue, May 8, 2012 at 4:13 PM, Kenneth S Mclane <ksmclane@us.ibm.com>
wrote:<br>
>> My template that cretaes the uri:<br>
>><br>
>> <td><a href="[% c.uri_for('/accountdetails/detail/')
%][% account.account_id<br>
>> %]">[% account.account_code %]</a></td><br>
>><br>
>> If someone could point me in the right direction, Ive been fighting
this for<br>
>> days.<br>
> Hi Kenneth,<br>
><br>
> I suppose you mean to use<br>
><br>
> [% c.uri_for('/accountdetails/detail/', account.account_id) %]<br>
><br>
> instead of<br>
><br>
> [% 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>
><br>
> Regards,<br>
<br>
<br>
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*<br>
T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien<br>
Handelsgericht Wien, FN 79340b<br>
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*<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>
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*<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>