Re: [CDBI] Adding metadata to objects

[prev] [thread] [next] [Date index for 2005/09/27]

From: Peter Speltz
Subject: Re: [CDBI] Adding metadata to objects
Date: 21:46 on 27 Sep 2005
The latest Class::DBI made a change to has_many where you can list
restraints at compile time. I think the syntax is like this:

CD->has_many('rock_tracks'  =3D> Track,  {constraint =3D> [ genre =3D> 'roc=
k' ]} );

The constraint is put in the meta_info  and when you say
CD->rock_tracks you only get back ones with genre rock.

However since you don't know your constraint until run time, perhaps
you could use the limiting form of  the has_many accessor:

CD->has_many(tracks =3D> Track);
my $rock_tracks =3D CD->tracks(genre=3D> 'rock');

I don't know if there is a public interface to set meta info.  I'd
like to know.

cheers
--
pjs

_______________________________________________
ClassDBI mailing list
ClassDBI@xxxxx.xxxxxxxxxxxxxxxx.xxx
http://lists.digitalcraftsmen.net/mailman/listinfo/classdbi

[CDBI] Adding metadata to objects
Bill Moseley 19:42 on 27 Sep 2005

Re: [CDBI] Adding metadata to objects
Kingsley Kerce 20:17 on 27 Sep 2005

Re: [CDBI] Adding metadata to objects
Bill Moseley 20:42 on 27 Sep 2005

Re: [CDBI] Adding metadata to objects
Wayne Walker 21:10 on 27 Sep 2005

Re: [CDBI] Adding metadata to objects
Peter Speltz 21:46 on 27 Sep 2005

Re: [CDBI] Adding metadata to objects
Kingsley Kerce 01:00 on 28 Sep 2005

Generated at 10:29 on 10 Oct 2005 by mariachi v0.52