[Jifty-commit] r2708 - in Jifty-DBI/branches/od: . lib/Jifty lib/Jifty/DBI

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Mon Jan 29 04:23:31 EST 2007


Author: audreyt
Date: Mon Jan 29 04:23:31 2007
New Revision: 2708

Modified:
   Jifty-DBI/branches/od/   (props changed)
   Jifty-DBI/branches/od/Changes
   Jifty-DBI/branches/od/SIGNATURE
   Jifty-DBI/branches/od/debian/changelog
   Jifty-DBI/branches/od/lib/Jifty/DBI.pm
   Jifty-DBI/branches/od/lib/Jifty/DBI/Record.pm
   Jifty-DBI/branches/od/lib/Jifty/DBI/Schema.pm

Log:
 r26951 at 122-126-37-36 (orig r2679):  jesse | 2007-01-28 21:30:31 +0800
  r21604 at hualien:  jesse | 2007-01-28 21:29:01 +0800
  * 0.34
 
 r26955 at 122-126-37-36 (orig r2683):  jesse | 2007-01-28 21:45:19 +0800
  r21614 at hualien:  jesse | 2007-01-28 21:44:54 +0800
  * Better handle the case when a model has no columns and we call ->columns on it.
 
 r26977 at 122-126-37-36 (orig r2705):  yves | 2007-01-29 16:51:47 +0800
 debian changes for 0.34
 
 r26979 at 122-126-37-36 (orig r2707):  audreyt | 2007-01-29 17:20:44 +0800
 * Introduce __create as a way to override/intercept raw row creation.


Modified: Jifty-DBI/branches/od/Changes
==============================================================================
--- Jifty-DBI/branches/od/Changes	(original)
+++ Jifty-DBI/branches/od/Changes	Mon Jan 29 04:23:31 2007
@@ -39,6 +39,10 @@
 - Switch to Object::Declare for schema declaration, fixing many annoyances such as the inability for two modules to refer to each other in their columns.
 - "refers Foo::Bar", a new alias to "refers_to Foo::Bar".
 
+0.34 Sun Jan 28 21:28:00 CST 2007
+
+- Added a method to the schema generator to output the SQL for a single column
+
 0.32 Fri Jan 26 20:51:12 CST 2007
 
 - Improved deprecation warning for "length is 42":

Modified: Jifty-DBI/branches/od/SIGNATURE
==============================================================================
--- Jifty-DBI/branches/od/SIGNATURE	(original)
+++ Jifty-DBI/branches/od/SIGNATURE	Mon Jan 29 04:23:31 2007
@@ -1,12 +1,12 @@
 This file contains message digests of all files listed in MANIFEST,
-signed via the Module::Signature module, version 0.55.
+signed via the Module::Signature module, version 0.41.
 
 To verify the content in this distribution, first make sure you have
 Module::Signature installed, then type:
 
     % cpansign -v
 
-It will check each file's integrity, as well as the signature's
+It would check each file's integrity, as well as the signature's
 validity.  If "==> Signature verified OK! <==" is not displayed,
 the distribution may already have been compromised, and you should
 not run its Makefile.PL or Build.PL.
@@ -21,7 +21,7 @@
 SHA1 d0943ab047f543c92405564ab77ba008052544e6 README
 SHA1 82d6ac3f6def48558d09f8b6e3b53ed4194d8c81 ROADMAP
 SHA1 9d304f35438f847863969f6a069598379f5a9db2 debian/README
-SHA1 9fd83b906fae49f559fe5d6f8a6912b63dd34154 debian/changelog
+SHA1 9c58e250307d4ff61d3aa2e6f2250fbacf094d07 debian/changelog
 SHA1 5d9474c0309b7ca09a182d888f73b37a8fe1362c debian/compat
 SHA1 24cc11618a487ebaa24b7538eca0c066a51ad513 debian/control
 SHA1 c1085db4f95bd6e7e7470ccab55f8adba10d5024 debian/rules
@@ -93,7 +93,7 @@
 SHA1 2f14a9a3247219233d5406ecb5e1950c757bc33b t/testmodels.pl
 SHA1 9b6cf7d135201f3f5ac4e29eaf180c85ba2e2bbf t/utils.pl
 -----BEGIN PGP SIGNATURE-----
-Version: GnuPG v1.4.3 (Darwin)
+Version: GnuPG v1.4.3 (GNU/Linux)
 
 iD8DBQFFugMLtLPdNzw1AaARAke3AKCaJeRcBcCuOf5DEFLK+q9JgVaa7gCdFeH5
 zofu7nWSY/r9+A4aXHcIhfQ=

Modified: Jifty-DBI/branches/od/debian/changelog
==============================================================================
--- Jifty-DBI/branches/od/debian/changelog	(original)
+++ Jifty-DBI/branches/od/debian/changelog	Mon Jan 29 04:23:31 2007
@@ -1,3 +1,9 @@
+libjifty-dbi-perl (0.34-1) unstable; urgency=low
+
+  * 0.34
+
+ -- AGOSTINI Yves <agostini at univ-metz.fr>  Mon, 29 Jan 2007 09:48:25 +0100
+
 libjifty-dbi-perl (0.32-1) unstable; urgency=low
 
   * deprecated use of length

Modified: Jifty-DBI/branches/od/lib/Jifty/DBI.pm
==============================================================================

Modified: Jifty-DBI/branches/od/lib/Jifty/DBI/Record.pm
==============================================================================
--- Jifty-DBI/branches/od/lib/Jifty/DBI/Record.pm	(original)
+++ Jifty-DBI/branches/od/lib/Jifty/DBI/Record.pm	Mon Jan 29 04:23:31 2007
@@ -406,7 +406,7 @@
                 <=> ( ( $a->type || '' ) eq 'serial' ) )
                 or ( ($a->sort_order || 0) <=> ($b->sort_order || 0))
                 or ( $a->name cmp $b->name )
-            } values %{ $self->COLUMNS }
+            } values %{ $self->COLUMNS || {} }
 
 
 	])}
@@ -968,6 +968,19 @@
         return ($before_ret) unless ($before_ret);
     }
 
+    my $ret = $self->__create(%attribs);
+    $self->after_create( \$ret ) if $self->can('after_create');
+    if ($class) {
+        $self->load_by_cols(id => $ret);
+        return ($self);
+    }
+    else {
+     return ($ret);
+    }
+}
+
+sub __create {
+    my ($self, %attribs) = @_;
     foreach my $column_name ( keys %attribs ) {
         my $column = $self->column($column_name);
         unless ($column) {
@@ -1011,15 +1024,7 @@
         }
     }
 
-    my $ret = $self->_handle->insert( $self->table, %attribs );
-    $self->after_create( \$ret ) if $self->can('after_create');
-    if ($class) {
-        $self->load_by_cols(id => $ret);
-        return ($self);
-    }
-    else {
-     return ($ret);
-    }
+    return $self->_handle->insert( $self->table, %attribs );
 }
 
 =head2 delete

Modified: Jifty-DBI/branches/od/lib/Jifty/DBI/Schema.pm
==============================================================================
--- Jifty-DBI/branches/od/lib/Jifty/DBI/Schema.pm	(original)
+++ Jifty-DBI/branches/od/lib/Jifty/DBI/Schema.pm	Mon Jan 29 04:23:31 2007
@@ -254,7 +254,7 @@
     my $name   = $column->name;
 
     my $from = (caller(2))[0];
-    if ($from =~ s/::Schema$//) {
+    if ($from =~ s/::Schema$// && $from !~ /Script/) {
         no strict 'refs';
 
         carp << "." unless $from->{_seen_column_warning}++;


More information about the Jifty-commit mailing list