# HG changeset patch # User Sylvain Thénault # Date 1246288445 -7200 # Node ID b08521e4eaabdc1087702203cd3644204002784d # Parent 58bef4f707ce9f4fa7e513ba58a8614e5301411c vocabulary method (eg field.choices) should now take the form instance as argument diff -r 58bef4f707ce -r b08521e4eaab web/formfields.py --- a/web/formfields.py Mon Jun 29 17:02:51 2009 +0200 +++ b/web/formfields.py Mon Jun 29 17:14:05 2009 +0200 @@ -164,7 +164,12 @@ widgets which desire it.""" if self.choices is not None: if callable(self.choices): - vocab = self.choices(req=form.req) + try: + vocab = self.choices(form=form) + except TypeError: + warn('vocabulary method (eg field.choices) should now take ' + 'the form instance as argument', DeprecationWarning) + vocab = self.choices(req=form.req) else: vocab = self.choices if vocab and not isinstance(vocab[0], (list, tuple)):