Re: Class::DBI 1.00 (almost)

[prev] [thread] [next] [Date index for 2005/06/18]

From: Peter Speltz
Subject: Re: Class::DBI 1.00 (almost)
Date: 20:48 on 18 Jun 2005
--0-69502995-1119127701=:57410
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
Content-Id: 
Content-Disposition: inline

--- Tony Bowden <tony-cdbitalk@xxxxx.xxx> wrote:

> On Sat, Jun 18, 2005 at 10:48:36AM -0700, Peter Speltz wrote:
> > >     - Removed hard-coded relationship names for subclassing (Peter
> Speltz)
> > This may be what you want and is probably  trivial but i notice as i am
> writing
> > a new relationship the relationship names are still hard coded in the remap
> > args sub.  
> 
> This is more likely to go smoothly if there was a (trivial) test for
> subclassing a relationship ... ;)
> 
> Tony

ok.  i was working with HasMany and the error messages there when you don't
provide args to the relationship have hardcoded has many.  MightHave and HasA
dont bother to give such nice messages. It would be nice if they did.  Here is
a test demonstrating all this.  Sorry no patches . i have t run now. 


use lib 't/testlib';
use Film;
use Actor;

package Class::DBI::Relationship::HasAWC;
use base 'Class::DBI::Relationship::HasA';

package Class::DBI::Relationship::HasManyWC;
use base 'Class::DBI::Relationship::HasMany';

package Class::DBI::Relationship::MustHave;
use base 'Class::DBI::Relationship::MightHave';

package main;

Film->add_relationship_type(hasa_wc => 'Class::DBI::Relationship::HasAWC');
Film->add_relationship_type(hasmany_wc =>
'Class::DBI::Relationship::HasManyWC');
Film->add_relationship_type(must_have => 'Class::DBI::Relationship::MustHave');
Film->add_relationship_type(mightyhave =>
'Class::DBI::Relationship::MightHave');

eval{Film->hasmany_wc()}; 
like($@, qr/hasmany_wc/,  "Subclassable error message in HasMany.pm");

eval{Film->hasmany_wc('actors')}; 
like($@, qr/hasmany_wc/,  "Subclassable error message in HasMany.pm");

eval{Film->hasa_wc()}; 
like($@, qr/hasa_wc/, "Subclassable error message in HasA.pm");

eval{Film->hasa_wc('actor')}; 
like($@, qr/hasa_wc/, "Subclassable error message in HasA.pm ");

eval{Film->must_have()}; 
like($@, qr/must_have/,  "Subclassable error message in MightHave.pm");

eval{Film->must_have('actor')}; 
like($@, qr/must_have/, "Subclassable error message in MightHave.pm");

# i believe you use a relationship under any name . 
eval{Film->mightyhave()}; 
like($@, qr/mightyhave/,  "Subclassable error message in MightHave.pm");

eval{Film->mightyhave('actor')}; 
like($@, qr/mightyhave/, "Subclassable error message in MightHave.pm");

pjs


		
__________________________________ 
Yahoo! Mail 
Stay connected, organized, and protected. Take the tour: 
http://tour.mail.yahoo.com/mailtour.html 

--0-69502995-1119127701=:57410
Content-Type: application/octet-stream; name="23-subclass_rels.t~"
Content-Transfer-Encoding: base64
Content-Description: 2235899131-23-subclass_rels.t~
Content-Disposition: attachment; filename="23-subclass_rels.t~"

IyEvdXNyL2Jpbi9wZXJsIC13Cgp1c2Ugc3RyaWN0Owp1c2UgVGVzdDo6TW9y
ZTsKdXNlIENsYXNzOjpEQkk7CgpCRUdJTiB7CglwbGFuICh0ZXN0cyA9PiA4
KTsKfQoKdXNlIGxpYiAndC90ZXN0bGliJzsKdXNlIEZpbG07CnVzZSBBY3Rv
cjsKCnBhY2thZ2UgQ2xhc3M6OkRCSTo6UmVsYXRpb25zaGlwOjpIYXNBV0M7
CnVzZSBiYXNlICdDbGFzczo6REJJOjpSZWxhdGlvbnNoaXA6Okhhc0EnOwoK
cGFja2FnZSBDbGFzczo6REJJOjpSZWxhdGlvbnNoaXA6Okhhc01hbnlXQzsK
dXNlIGJhc2UgJ0NsYXNzOjpEQkk6OlJlbGF0aW9uc2hpcDo6SGFzTWFueSc7
CgpwYWNrYWdlIENsYXNzOjpEQkk6OlJlbGF0aW9uc2hpcDo6TXVzdEhhdmU7
CnVzZSBiYXNlICdDbGFzczo6REJJOjpSZWxhdGlvbnNoaXA6Ok1pZ2h0SGF2
ZSc7CgpwYWNrYWdlIG1haW47CgpGaWxtLT5hZGRfcmVsYXRpb25zaGlwX3R5
cGUoaGFzYV93YyA9PiAnQ2xhc3M6OkRCSTo6UmVsYXRpb25zaGlw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
Y3RvcicpfTsgCmxpa2UoJEAsIHFyL211c3RfaGF2ZS8sICJTdWJjbGFzc2Fi
bGUgZXJyb3IgbWVzc2FnZSBpbiBNaWdodEhhdmUucG0iKTsKCiMgaSBiZWxp
ZXZlIHlvdSB1c2UgYSByZWxhdGlvbnNoaXAgdW5kZXIgYW55IG5hbWUgLiAK
ZXZhbHtGaWxtLT5taWdodHloYXZlKCl9OyAKbGlrZSgkQCwgcXIvbWlnaHR5
aGF2ZS8sICAiU3ViY2xhc3NhYmxlIGVycm9yIG1lc3NhZ2UgaW4gTWlnaHRI
YXZlLnBtIik7CgpldmFse0ZpbG0tPm1pZ2h0eWhhdmUoJ2FjdG9yJyl9OyAK
bGlrZSgkQCwgcXIvbWlnaHR5aGF2ZS8sICJTdWJjbGFzc2FibGUgZXJyb3Ig
bWVzc2FnZSBpbiBNaWdodEhhdmUucG0iKTsKCgo=

--0-69502995-1119127701=:57410--

(message missing)

Class::DBI 1.00 (almost)
Tony Bowden 12:57 on 18 Jun 2005

Re: Class::DBI 1.00 (almost)
Will Hawes 14:56 on 18 Jun 2005

Re: Class::DBI 1.00 (almost)
Tony Bowden 15:15 on 18 Jun 2005

Re: Class::DBI 1.00 (almost)
Will Hawes 15:50 on 18 Jun 2005

Re: Class::DBI 1.00 (almost)
Tony Bowden 18:56 on 18 Jun 2005

Re: Class::DBI 1.00 (almost)
Matt S Trout 16:39 on 18 Jun 2005

Re: Class::DBI 1.00 (almost)
Andy Grundman 16:41 on 18 Jun 2005

Re: Class::DBI 1.00 (almost)
Tony Bowden 18:58 on 18 Jun 2005

Re: Class::DBI 1.00 (almost)
Peter Speltz 19:34 on 21 Jun 2005

Re: Class::DBI 1.00 (almost)
Tim Bunce 23:17 on 21 Jun 2005

Re: Class::DBI 1.00 (almost)
Peter Speltz 19:28 on 22 Jun 2005

Re: Class::DBI 1.00 (almost)
Tim Bunce 09:24 on 23 Jun 2005

Re: Class::DBI 1.00 (almost)
Tim Bunce 11:44 on 23 Jun 2005

Re: Class::DBI 1.00 (almost)
Tony Bowden 13:06 on 23 Jun 2005

Re: Class::DBI 1.00 (almost)
Michael Peters 13:49 on 23 Jun 2005

Re: Class::DBI 1.00 (almost)
Peter Speltz 15:24 on 23 Jun 2005

Re: Class::DBI 1.00 (almost)
Peter Speltz 17:48 on 18 Jun 2005

Re: Class::DBI 1.00 (almost)
Tony Bowden 18:59 on 18 Jun 2005

Re: Class::DBI 1.00 (almost)
Peter Speltz 20:48 on 18 Jun 2005

Re: Class::DBI 1.00 (almost)
Perrin Harkins 18:05 on 18 Jun 2005

Re: Class::DBI 1.00 (almost)
Tony Bowden 19:04 on 18 Jun 2005

Re: Class::DBI 1.00 (almost)
Perrin Harkins 19:12 on 18 Jun 2005

Re: Class::DBI 1.00 (almost)
Perrin Harkins 02:15 on 19 Jun 2005

Re: Class::DBI 1.00 (almost)
Tony Bowden 08:07 on 19 Jun 2005

Re: Class::DBI 1.00 (almost)
Michael G Schwern 20:33 on 18 Jun 2005

Re: Class::DBI 1.00 (almost)
Tony Bowden 22:43 on 18 Jun 2005

Re: Class::DBI 1.00 (almost)
Tony Bowden 23:14 on 18 Jun 2005

Re: Class::DBI 1.00 (almost)
Rhesa Rozendaal 00:06 on 19 Jun 2005

Re: Class::DBI 1.00 (almost)
Tony Bowden 08:49 on 19 Jun 2005

Re: Class::DBI 1.00 (almost)
Michael G Schwern 03:22 on 19 Jun 2005

Re: Class::DBI 1.00 (almost)
Tony Bowden 08:46 on 19 Jun 2005

Re: Class::DBI 1.00 (almost)
Edward J. Sabol 04:49 on 19 Jun 2005

Re: Class::DBI 1.00 (almost)
Tony Bowden 08:49 on 19 Jun 2005

Re: Class::DBI 1.00 (almost)
William Ross 03:55 on 19 Jun 2005

Re: Class::DBI 1.00 (almost)
William Ross 19:22 on 21 Jun 2005

Re: Class::DBI 1.00 (almost)
Brad Bowman 09:23 on 19 Jun 2005

Re: Class::DBI 1.00 (almost)
Perrin Harkins 13:48 on 19 Jun 2005

Re: Class::DBI 1.00 (almost)
Peter Speltz 14:31 on 19 Jun 2005

Re: Class::DBI 1.00 (almost)
Tony Bowden 15:25 on 19 Jun 2005

Re: Class::DBI 1.00 (almost)
Edward J. Sabol 18:21 on 19 Jun 2005

Re: Class::DBI 1.00 (almost)
Tony Bowden 18:38 on 19 Jun 2005

Re: Class::DBI 1.00 (almost)
Perrin Harkins 03:52 on 20 Jun 2005

Re: Class::DBI 1.00 (almost)
Michael G Schwern 04:16 on 20 Jun 2005

Re: Class::DBI 1.00 (almost)
Edward J. Sabol 04:21 on 20 Jun 2005

Re: Class::DBI 1.00 (almost)
Perrin Harkins 04:50 on 20 Jun 2005

Re: Class::DBI 1.00 (almost)
Edward J. Sabol 04:59 on 20 Jun 2005

Re: Class::DBI 1.00 (almost)
Tony Bowden 08:26 on 20 Jun 2005

Re: Class::DBI 1.00 (almost)
Edward J. Sabol 16:35 on 20 Jun 2005

Re: Class::DBI 1.00 (almost)
Tony Bowden 16:50 on 20 Jun 2005

Class::DBI 1.00 (almost)
Hartmaier Alexander 10:08 on 20 Jun 2005

Re: Class::DBI 1.00 (almost)
Tony Bowden 10:47 on 20 Jun 2005

->create or ->insert (was: Class::DBI 1.00 (almost))
=?ISO-8859-1?Q?Ask_Bj=F8rn_Hansen?= 20:14 on 20 Jun 2005

Re: Class::DBI 1.00 (almost)
Perrin Harkins 15:03 on 20 Jun 2005

Re: Class::DBI 1.00 (almost)
Charles Bailey 15:18 on 20 Jun 2005

Re: Class::DBI 1.00 (almost)
Tony Bowden 15:30 on 20 Jun 2005

Re: Class::DBI 1.00 (almost)
Charles Bailey 17:28 on 20 Jun 2005

Re: Class::DBI 1.00 (almost)
Perrin Harkins 18:17 on 20 Jun 2005

Class::DBI 1.00 (almost)
Hartmaier Alexander 11:40 on 20 Jun 2005

Re: Class::DBI 1.00 (almost)
Tony Bowden 12:45 on 20 Jun 2005

Class::DBI 1.00 (almost)
Hartmaier Alexander 13:33 on 20 Jun 2005

Re: Class::DBI 1.00 (almost)
Tony Bowden 13:39 on 20 Jun 2005

Re: Class::DBI 1.00 (almost)
Michael Peters 13:34 on 20 Jun 2005

Re: Class::DBI 1.00 (almost)
William Ross 14:04 on 20 Jun 2005

Re: Class::DBI 1.00 (almost)
Perrin Harkins 14:27 on 20 Jun 2005

Re: Class::DBI 1.00 (almost)
Perrin Harkins 14:42 on 20 Jun 2005

Class::DBI 1.00 (almost)
Hartmaier Alexander 14:03 on 20 Jun 2005

Re: Class::DBI 1.00 (almost)
Cees Hek 14:13 on 20 Jun 2005

Re: Class::DBI 1.00 (almost)
Tony Bowden 14:15 on 20 Jun 2005

Class::DBI 1.00 (almost)
Hartmaier Alexander 14:55 on 20 Jun 2005

Re: Class::DBI 1.00 (almost)
merlyn (Randal L. Schwartz) 15:42 on 20 Jun 2005

Re: Class::DBI 1.00 (almost)
Tony Bowden 15:56 on 20 Jun 2005

Re: Class::DBI 1.00 (almost)
Edward J. Sabol 17:11 on 20 Jun 2005

Re: Class::DBI 1.00 (almost)
Tony Bowden 17:38 on 20 Jun 2005

Re: Class::DBI 1.00 (almost)
Matt S Trout 18:00 on 20 Jun 2005

Re: Class::DBI 1.00 (almost)
Edward J. Sabol 18:16 on 20 Jun 2005

Class::DBI 1.00 (almost)
Hartmaier Alexander 17:40 on 20 Jun 2005

Re: Class::DBI 1.00 (almost)
Tony Bowden 08:11 on 24 Jun 2005

Re: Class::DBI 1.00 (almost)
Tim Bunce 10:03 on 24 Jun 2005

Re: Class::DBI 1.00 (almost)
Tony Bowden 10:23 on 24 Jun 2005

Re: Class::DBI 1.00 (almost)
Tim Bunce 00:08 on 25 Jun 2005

Class::DBI 1.00 (almost)
Hartmaier Alexander 17:45 on 20 Jun 2005

Re: Class::DBI 1.00 (almost)
Andy Grundman 23:49 on 21 Jun 2005

Re: Class::DBI 1.00 (almost)
Hartmaier Alexander 13:26 on 23 Jun 2005

Re: Class::DBI 1.00 (almost)
Tony Bowden 14:09 on 23 Jun 2005

Re: Class::DBI 1.00 (almost)
Hartmaier Alexander 14:27 on 23 Jun 2005

RE: Class::DBI 1.00 (almost)
Andrew O'Brien 23:12 on 23 Jun 2005

Re: Class::DBI 1.00 (almost)
Tony Bowden 07:43 on 24 Jun 2005

Re: Class::DBI 1.00 (almost)
=?ISO-8859-1?Q?Ask_Bj=F8rn_Hansen?= 07:48 on 24 Jun 2005

RE: Class::DBI 1.00 (almost)
Andrew O'Brien 07:53 on 24 Jun 2005

Re: Class::DBI 1.00 (almost)
Tony Bowden 08:00 on 24 Jun 2005

Generated at 16:36 on 28 Jul 2005 by mariachi v0.52