web/formfields.py
changeset 4386 cf8842b69379
parent 4382 6fb02edd05da
child 4388 15c6607c4bda
--- a/web/formfields.py	Wed Jan 27 09:24:35 2010 +0100
+++ b/web/formfields.py	Wed Jan 27 09:25:40 2010 +0100
@@ -264,12 +264,15 @@
                     vocab = self.choices(form=form, field=self)
             except TypeError:
                 warn('[3.6]  %s: choices should now take '
-                     'the form and field as named arguments', self)
+                     'the form and field as named arguments' % self,
+                     DeprecationWarning)
                 try:
-                    vocab = self.choices(req=form._cw)
+                    vocab = self.choices(form=form)
                 except TypeError:
                     warn('[3.3]  %s: choices should now take '
-                         'the form and field as named arguments', self)
+                         'the form and field as named arguments' % self,
+                         DeprecationWarning)
+                    vocab = self.choices(req=form._cw)
         else:
             vocab = self.choices
         if vocab and not isinstance(vocab[0], (list, tuple)):