[jifty-devel] Getting name instead of ID (in refers_to column)

Jesse Vincent jesse at bestpractical.com
Wed Mar 7 13:42:04 EST 2007


On Mar 6, 2007, at 5:01 PM, mraptor wrote:

> hi,
>
> I was wondering is there an easy way to display in a FORM instead
> of the ID the Name from the fk table.
> The best (or should I say absurd) thing I came to is this :
>
> My::Model::Client->new->load( $action->form_field($name)- 
> >current_value )->column('client_name')
>
> still getting this error :
>
> Can't locate object method "column" via package "Fetched from
> cache" (perhaps you forgot to load "Fetched from cache"?)
>

Load doesn't return the object by default.

> my $c = My::Model::Client->new;



> $c->load( $action->form_field($name)->current_value );

> $c->column('client_name')



> ==
>
> Also I tried to access :
>
> $action->id()
>
> It should be accessible because the Action is descendant of
> Jifty::Action::Record::Update or should I say My::Action::UpdateTable,
> but i get this :
>
> Can't locate object method "id" via package "My::Action::UpdateTable
>
>
>
> -- 
> Gee I don't have signature
> _______________________________________________
> jifty-devel mailing list
> jifty-devel at lists.jifty.org
> http://lists.jifty.org/cgi-bin/mailman/listinfo/jifty-devel
>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
Url : http://lists.bestpractical.com/pipermail/jifty-devel/attachments/20070307/860a77a3/PGP.pgp


More information about the jifty-devel mailing list