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

Ian Sillitoe ian at sillit.com
Sat May 2 20:28:04 GMT 2009


This is really a matter for the DBIx::Class mailing list

But I'm still not clear why I need to use the belongs_to relationship when
> the affiliation_id is directly available in the People table.


If you only want to access the affiliation_id column then no, you wouldn't
need to define the belongs_to relationship. However it seems the belongs_to
relationship was declared with the same name as the "affiliation_id" column,
so rather than the accessor returning the column value that you expected,
you got the belongs_to relationship (which happens to have it's own
"affiliation_id" column accessor).

Have a look at the docs for declaring the belongs_to() relationship and take
note of the difference between the relationship name (e.g. "affiliation")
and the name of the foreign key used to define the relationship (e.g.
"affiliation_id").


http://search.cpan.org/dist/DBIx-Class/lib/DBIx/Class/Relationship.pm#belon=
gs_to

Also maybe take a closer look at the usage examples in my last post - that
should really explain the same as above.

Cheers,
-- =

Ian Sillitoe
CATH Team -- http://cathdb.info
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20090502/ac006=
83c/attachment.htm


More information about the Catalyst mailing list