Re: [CDBI] How do I add a method to a loaded class?
[prev]
[thread]
[next]
[Date index for 2005/08/07]
Opps sent on accident: I was trying to say try:
my @all =3D (MyTable->columns, MyCable->columns('TEMP'));
But check the docs for syntax or maybe changed behavior in .99.
On 8/7/05, Peter Speltz <peterspeltz@xxxxx.xxx> wrote:
> The columns method with no arguments returns 'ALL' columns. This
> strangely does not return TEMP columns in .96 (probably for good
> reason though). Maybe this has changed in .99. Read the docs but im
> guessing if you want TEMP columns to be lumped with ALL columns you
> will have to call them explicitly . Try something like
>=20
> my @all Unless it has been changed in .99,
>=20
> On 8/7/05, Alex Aminoff <alex@xxxxxxxxx.xxx> wrote:
> >
> >
> >
> > ----- Original Message -----
> > From: John Beppu
> > To: Alex Aminoff
> > Cc: classdbi@xxxxx.xxxxxxxxxxxxxxxx.xxx
> > Sent: Sunday, August 07, 2005 12:13 AM
> > Subject: Re: [CDBI] How do I add a method to a loaded class?
> >
> > On 8/6/05, Alex Aminoff <alex@xxxxxxxxx.xxx> wrote:
> >
> > >
> > >
> > > Very basic newbie question...
> > >
> > > I have loaded up my database into a Class::DBI structure using
> > Class::DBI::Loader. Now I would like to add a method to one of the
> > autogenerated classes that will calculate some stuff based on various d=
ata,
> > but otherwise appear in most respects like any other column from the DB=
. I'm
> > pretty sure I want something using MyTable->columns( TEMP =3D> calcfiel=
d ).
> >
> >
> >
> > Let's step back a bit. Why do you need to have the calcfield() method
> > appear as a column? Isn't it enough that you managed to put the method=
into
> > the MyTable namespace and are able to call it?
> >
> >
> >
> > I want to generate an html table screen of the data, using
> > Class::DBI::Plugin::HTML, which appears to rely on ->columns() to find =
out
> > what columns should be displayed. Yes, one could just list the columns
> > explicitly, but that defeats the elegance of not having to do so; plus,=
if I
> > change my database schema in mysql, I dont want to have to sync up chan=
ges
> > in my perl code.
> >
> > I'm not actually using Class:DBI::Plugin::HTML, but rather my own modul=
e
> > which will work with HTML::Template, just because that is what I'm fami=
liar
> > with already, but the principle is the same.
> >
> > - Alex
> >
> > _______________________________________________
> > ClassDBI mailing list
> > ClassDBI@xxxxx.xxxxxxxxxxxxxxxx.xxx
> > http://lists.digitalcraftsmen.net/mailman/listinfo/classdbi
> >
> >
> >
>=20
>=20
> --
> pjs
>=20
--=20
pjs
_______________________________________________
ClassDBI mailing list
ClassDBI@xxxxx.xxxxxxxxxxxxxxxx.xxx
http://lists.digitalcraftsmen.net/mailman/listinfo/classdbi
|
(message missing)
|