[Catalyst] Catalyst Model Question

Proud Dzambukira proudd at gmail.com
Sat Jan 31 13:48:05 GMT 2009


Hello all,

I am designing a system which consists of two parts:

A generic, type agnostic "Data" table:

__PACKAGE__->add_columns(
  "id",
  { data_type =3D> "INTEGER", is_nullable =3D> 0, size =3D> undef },
  "item",
  { data_type =3D> "TEXT", is_nullable =3D> 0, size =3D> undef },
  "value",
  { data_type =3D> "REAL", is_nullable =3D> 0, size =3D> undef },
  "units",
  { data_type =3D> "INTEGER", is_nullable =3D> 0, size =3D> undef },
  "datatype",
  { data_type =3D> "TEXT", is_nullable =3D> 0, size =3D> undef },
  "datatype_id",
  { data_type =3D> "INTEGER", is_nullable =3D> 0, size =3D> undef },
);

where "datatype" is always one of a set of acceptable data types, each
represented by its own table,  and "datatype_id" is the foreign id key in
the corresponding (always specified) "datatype" table.

My question is -- does this design look odd to work in Catalyst? And
secondly, is there a straightforward way, using catalyst, to create the
right accessor methods to relate the "Data" table to its corresponding
"datatype" table ?

Thank you very much for your help.

pd
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20090131/7fa14=
b42/attachment.htm


More information about the Catalyst mailing list