# HG changeset patch # User Sylvain Thénault # Date 1264580740 -3600 # Node ID cf8842b693799d2b726f482ae115328272fca8d9 # Parent 820aa03f71ad2d3b06c933479f15552aa713d2ae [forms] fix backward compat for field.choices arguments diff -r 820aa03f71ad -r cf8842b69379 web/formfields.py --- 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)):