web/formfields.py
changeset 4386 cf8842b69379
parent 4382 6fb02edd05da
child 4388 15c6607c4bda
equal deleted inserted replaced
4385:820aa03f71ad 4386:cf8842b69379
   262                     vocab = self.choices(form=form)
   262                     vocab = self.choices(form=form)
   263                 else:
   263                 else:
   264                     vocab = self.choices(form=form, field=self)
   264                     vocab = self.choices(form=form, field=self)
   265             except TypeError:
   265             except TypeError:
   266                 warn('[3.6]  %s: choices should now take '
   266                 warn('[3.6]  %s: choices should now take '
   267                      'the form and field as named arguments', self)
   267                      'the form and field as named arguments' % self,
       
   268                      DeprecationWarning)
   268                 try:
   269                 try:
   269                     vocab = self.choices(req=form._cw)
   270                     vocab = self.choices(form=form)
   270                 except TypeError:
   271                 except TypeError:
   271                     warn('[3.3]  %s: choices should now take '
   272                     warn('[3.3]  %s: choices should now take '
   272                          'the form and field as named arguments', self)
   273                          'the form and field as named arguments' % self,
       
   274                          DeprecationWarning)
       
   275                     vocab = self.choices(req=form._cw)
   273         else:
   276         else:
   274             vocab = self.choices
   277             vocab = self.choices
   275         if vocab and not isinstance(vocab[0], (list, tuple)):
   278         if vocab and not isinstance(vocab[0], (list, tuple)):
   276             vocab = [(x, x) for x in vocab]
   279             vocab = [(x, x) for x in vocab]
   277         if self.internationalizable:
   280         if self.internationalizable: