one to one relationship revisited (has_own)

[prev] [thread] [next] [Date index for 2005/01/20]

From: Peter Speltz
Subject: one to one relationship revisited (has_own)
Date: 22:26 on 20 Jan 2005
How long winded should i be?? ... I'll start with not very.

i think it would be cool if programs could distinguish if has_a relationships
were one to one or many to one. AsForm treats them as many to one by making a
select box of all existing foreign objects. 

So, I'm thinking of making a "has_own" relationship. I think it will be real
short.

package Class::DBI::Relationship::has_own;
use base qw/Class::DBI::Relationship::has_own;
1;

No internal differences i can think of but different name so systems will know
this is a true one to one. So for example:
Person->has_own(phone => "Phone");

 Then AsForm could instead of making a select box of all phones, make input
box(s) for column(s) in phone. 

Furthermore, i thought that create and update may be able to automatically
create and update phone:

$prsn = Person->create( {...., phone_id => {...} } );
$prsn->upd .. . Well update wouldn't need to do anything different.
Delete however would cascade like has_many. 


thanks and I look forward to hearing "See this thread
http://wetalkedaboutthisyoulazyidiot"/



=====
pjs

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

(message missing)

one to one relationship revisited (has_own)
Peter Speltz 22:26 on 20 Jan 2005

Re: one to one relationship revisited (has_own)
Perrin Harkins 21:59 on 21 Jan 2005

Re: one to one relationship revisited (has_own)
Peter Speltz 05:11 on 22 Jan 2005

Re: one to one revisited (has_own)
Peter Speltz 18:16 on 22 Jan 2005

Re: one to one revisited (has_own)
William McKee 15:39 on 24 Jan 2005

Re: one to one revisited (has_own)
Peter Speltz 16:01 on 24 Jan 2005

Re: one to one revisited (has_own)
Andreas Fromm 08:19 on 25 Jan 2005

Re: one to one revisited (has_own)
Peter Speltz 19:34 on 25 Jan 2005

Selecting from a datetime field in MySQL
John Day 22:24 on 25 Jan 2005

Re: Selecting from a datetime field in MySQL
Perrin Harkins 22:29 on 25 Jan 2005

Re: one to one revisited (has_own)
Peter Speltz 23:24 on 26 Jan 2005

Re: one to one revisited (has_own)
Peter Speltz 17:40 on 01 Feb 2005

Re: one to one revisited (has_own)
Peter Speltz 08:23 on 25 Jan 2005

Generated at 12:39 on 05 Feb 2005 by mariachi v0.52