anunnakian / sqlautocode

Automatically exported from code.google.com/p/sqlautocode
Other
0 stars 0 forks source link

Patch to use server defaults as defaults for generated code. #23

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
--- ./formatter.py.orig 2010-02-10 13:10:31.000000000 -0000
+++ ./formatter.py  2010-02-10 13:10:45.000000000 -0000
@@ -41,6 +41,9 @@
         kwarg.append( 'onupdate')
     if self.default:
         kwarg.append( 'default')
+    elif self.server_default:
+        self.default = self.server_default.arg
+        kwarg.append( 'default')
     ks = ', '.join('%s=%r' % (k, getattr(self, k)) for k in kwarg )

     name = self.name

Original issue reported on code.google.com by eiken...@gmail.com on 11 Feb 2010 at 8:09

GoogleCodeExporter commented 8 years ago
Fixed on trunk - will make it into 0.6 final

Original comment by spamsch@gmail.com on 30 Oct 2010 at 1:38