Massimo,

I'm not sure how best to submit patches.

I have a small fix to dal.py to fix a problem when MySQL backends are
given a table definition having only the implicit primary key field:

# HG changeset patch
# Parent ff8a9ebefcc5b540cd9036e2711e6df46171e2f7

diff -r ff8a9ebefcc5 gluon/dal.py
--- a/gluon/dal.py      Sun Nov 21 16:04:27 2010 -0600
+++ b/gluon/dal.py      Mon Nov 22 17:15:59 2010 -0500
@@ -2578,7 +2578,7 @@

         # backend-specific extensions to fields
         if self._db._dbname == 'mysql':
-            if not self._primarykey:
+            if not hasattr(self, "_primarykey"):
                 fields.append('PRIMARY KEY(%s)' % self.fields[0])
             other = ' ENGINE=InnoDB CHARACTER SET utf8;'

My patch queue is at https://[email protected]/bradobro/web2py_patches,
and there are some notes its wiki.

Regards,
Brad

Reply via email to