[PATCH] give us more temporary column groups

[prev] [thread] [next] [Date index for 2004/12/12]

From: Aaron Trevena
Subject: [PATCH] give us more temporary column groups
Date: 17:54 on 12 Dec 2004
Hi all,

We have been working on adding new relationships and want to abuse the 
column groups. Currently Class::DBI::Relationship::IsA uses the TEMP 
column group to ensure backwards compatibility with built in CDBI 
relationships. This can break stuff as users might want to use the TEMP 
group for their own temporary stuff.

Therefore we would like to have any column group that starts with __TEMP 
to be treated the same as TEMP. This will be useful for people extending 
or subclassing CDBI as well as users who may want to group temporary 
attributes and treat them differently.

This would make CDBI a lot easier to extend without sacrificing simplicity 
or backwards compatability.

Thanks,

A.

patch :

--- DBI.pm      2004-12-12 17:46:08.000000000 +0000
+++ /usr/lib/perl5/site_perl/5.8.1/Class/DBI.pm 2004-04-30 
08:22:12.000000000 +0100
@@ -845,7 +845,7 @@

  sub _flesh {
         my ($self, @groups) = @_;
-       my @real = grep $_ =~ /(?:TEMP|__TEMP.*)/, @groups;
+       my @real = grep $_ ne "TEMP", @groups;
         if (my @want = grep !$self->_attribute_exists($_),
                 $self->__grouper->columns_in(@real)) {
                 my %row;


        -- 
        Aaron J Trevena - Perl Hacker, Kung Fu Geek, Internet Consultant
AutoDia --- Automatic UML and HTML Specifications from Perl, C++ 
and Any Datasource with a Handler.     http://droogs.org/autodia

[PATCH] give us more temporary column groups
Aaron Trevena 17:54 on 12 Dec 2004

Re: [PATCH] give us more temporary column groups
Aaron Trevena 18:44 on 12 Dec 2004

Generated at 01:36 on 13 Dec 2004 by mariachi v0.52