Re: Cross between MightHave and HasMany?

[prev] [thread] [next] [Date index for 2004/11/05]

From: William McKee
Subject: Re: Cross between MightHave and HasMany?
Date: 14:21 on 05 Nov 2004
On Tue, Nov 02, 2004 at 02:06:45PM -0800, Peter Speltz wrote:
> But if you want , Have you tried making a Temp column of person category? I
> haven't tried Temp but from reading the docs, i hope to be able to say:
> 
> Person->columns( Temp => [ "category"]);
> Person->has_a(category => "PersonCategory");
> 
> .... then  have everything work just like if the category column was in the
> person table.  It should be able to update the PersonCategory object.

Wouldn't using might_have provide the same results with less code?

e.g.

  Person->might_have(category => "PersonCategory" => qw/cat_id/);

This brings up the question of whether CDBI makes category into a Temp
column. Tony?


> .... then  have everything work just like if the category column was in the
> person table.  It should be able to update the PersonCategory object.
> 
> prsn_obj->category->cat_id($cgi_val);
> prsn_obj->update; # or maybe prsn_obj->category->update;

I would think that the prsn_obj->category->update would be the correct
call. Personally, I wouldn't use this setup with a M2M relation. To get
a category name, you'd need to use something like:

  prsn_obj->category->category;

Or stringify Category to the category column (which potentially
introduces other weirdness).


William

        -- 
        Knowmad Services Inc.
http://www.knowmad.com

(message missing)

Cross between MightHave and HasMany?
Jess Robinson 19:47 on 02 Nov 2004

Re: Cross between MightHave and HasMany?
Kingsley Kerce 20:08 on 02 Nov 2004

Re: Cross between MightHave and HasMany?
Jess Robinson 21:20 on 02 Nov 2004

Re: Cross between MightHave and HasMany?
Kingsley Kerce 21:35 on 02 Nov 2004

Re: Cross between MightHave and HasMany?
Jess Robinson 22:09 on 02 Nov 2004

Re: Cross between MightHave and HasMany?
Tony Bowden 23:43 on 02 Nov 2004

Re: Cross between MightHave and HasMany?
Peter Speltz 22:06 on 02 Nov 2004

Re: Cross between MightHave and HasMany?
Kingsley Kerce 22:39 on 02 Nov 2004

Re: Cross between MightHave and HasMany?
Jess Robinson 06:35 on 03 Nov 2004

Re: Cross between MightHave and HasMany?
William McKee 14:21 on 05 Nov 2004

Re: Cross between MightHave and HasMany?
Peter Speltz 14:36 on 05 Nov 2004

Re: Cross between MightHave and HasMany?
Jess Robinson 20:06 on 05 Nov 2004

Re: Cross between MightHave and HasMany?
William McKee 03:34 on 06 Nov 2004

Generated at 11:34 on 01 Dec 2004 by mariachi v0.52