Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-wtf-peewee for openSUSE:Factory checked in at 2024-01-03 12:24:30 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-wtf-peewee (Old) and /work/SRC/openSUSE:Factory/.python-wtf-peewee.new.28375 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-wtf-peewee" Wed Jan 3 12:24:30 2024 rev:2 rq:1135637 version:3.0.5 Changes: -------- --- /work/SRC/openSUSE:Factory/python-wtf-peewee/python-wtf-peewee.changes 2022-04-17 23:52:11.754500750 +0200 +++ /work/SRC/openSUSE:Factory/.python-wtf-peewee.new.28375/python-wtf-peewee.changes 2024-01-03 12:24:36.574647658 +0100 @@ -1,0 +2,7 @@ +Fri Dec 29 10:23:54 UTC 2023 - Dirk Müller <[email protected]> + +- udpate to 3.0.5: + * Workaround for backwards-incompatible clown change in wtforms + 3.1.0 + +------------------------------------------------------------------- Old: ---- wtf-peewee-3.0.4.tar.gz New: ---- wtf-peewee-3.0.5.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-wtf-peewee.spec ++++++ --- /var/tmp/diff_new_pack.rOOMjN/_old 2024-01-03 12:24:37.266672942 +0100 +++ /var/tmp/diff_new_pack.rOOMjN/_new 2024-01-03 12:24:37.270673089 +0100 @@ -1,7 +1,7 @@ # # spec file for package python-wtf-peewee # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,7 +18,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-wtf-peewee -Version: 3.0.4 +Version: 3.0.5 Release: 0 Summary: WTForms integration for peewee models License: MIT ++++++ wtf-peewee-3.0.4.tar.gz -> wtf-peewee-3.0.5.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wtf-peewee-3.0.4/PKG-INFO new/wtf-peewee-3.0.5/PKG-INFO --- old/wtf-peewee-3.0.4/PKG-INFO 2022-04-16 19:50:34.000000000 +0200 +++ new/wtf-peewee-3.0.5/PKG-INFO 2023-10-25 19:16:26.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: wtf-peewee -Version: 3.0.4 +Version: 3.0.5 Summary: WTForms integration for peewee models Home-page: https://github.com/coleifer/wtf-peewee/ Author: Charles Leifer diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wtf-peewee-3.0.4/setup.py new/wtf-peewee-3.0.5/setup.py --- old/wtf-peewee-3.0.4/setup.py 2022-04-16 19:49:27.000000000 +0200 +++ new/wtf-peewee-3.0.5/setup.py 2023-10-25 19:16:02.000000000 +0200 @@ -3,7 +3,7 @@ setup( name='wtf-peewee', - version='3.0.4', + version='3.0.5', url='https://github.com/coleifer/wtf-peewee/', license='MIT', author='Charles Leifer', diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wtf-peewee-3.0.4/wtf_peewee.egg-info/PKG-INFO new/wtf-peewee-3.0.5/wtf_peewee.egg-info/PKG-INFO --- old/wtf-peewee-3.0.4/wtf_peewee.egg-info/PKG-INFO 2022-04-16 19:50:34.000000000 +0200 +++ new/wtf-peewee-3.0.5/wtf_peewee.egg-info/PKG-INFO 2023-10-25 19:16:26.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: wtf-peewee -Version: 3.0.4 +Version: 3.0.5 Summary: WTForms integration for peewee models Home-page: https://github.com/coleifer/wtf-peewee/ Author: Charles Leifer diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wtf-peewee-3.0.4/wtfpeewee/fields.py new/wtf-peewee-3.0.5/wtfpeewee/fields.py --- old/wtf-peewee-3.0.4/wtfpeewee/fields.py 2022-01-07 19:17:35.000000000 +0100 +++ new/wtf-peewee-3.0.5/wtfpeewee/fields.py 2023-10-25 19:16:06.000000000 +0200 @@ -14,6 +14,7 @@ except ImportError: raise ImportError('Could not import markupsafe.Markup. Please install ' 'markupsafe.') +from wtforms import __version__ as wtforms_version from wtforms import fields, form, widgets from wtforms.fields import FormField, _unset_value from wtforms.validators import ValidationError @@ -38,12 +39,20 @@ return super(StaticAttributesMixin, self).__call__(**kwargs) +if wtforms_version < '3.1.0': + def wtf_choice(*args): + return args +else: + def wtf_choice(*args): + return args + ({},) + + class BooleanSelectField(fields.SelectFieldBase): widget = widgets.Select() def iter_choices(self): - yield ('1', 'True', self.data) - yield ('', 'False', not self.data) + yield wtf_choice('1', 'True', self.data) + yield wtf_choice('', 'False', not self.data) def process_data(self, value): try: @@ -164,10 +173,10 @@ def iter_choices(self): if self.allow_blank: - yield (u'__None', self.blank_text, self.data is None) + yield wtf_choice(u'__None', self.blank_text, self.data is None) for value, label in self.choices: - yield (value, label, self.coerce(value) == self.data) + yield wtf_choice(value, label, self.coerce(value) == self.data) def process_data(self, value): if value is None: @@ -253,10 +262,10 @@ def iter_choices(self): if self.allow_blank: - yield (u'__None', self.blank_text, self.data is None) + yield wtf_choice(u'__None', self.blank_text, self.data is None) for obj in self.query.clone(): - yield (obj._pk, self.get_label(obj), obj == self.data) + yield wtf_choice(obj._pk, self.get_label(obj), obj == self.data) def process_formdata(self, valuelist): if valuelist: @@ -304,7 +313,7 @@ def iter_choices(self): for obj in self.query.clone(): - yield (obj._pk, self.get_label(obj), obj in self.data) + yield wtf_choice(obj._pk, self.get_label(obj), obj in self.data) def process_formdata(self, valuelist): if valuelist: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wtf-peewee-3.0.4/wtfpeewee/tests.py new/wtf-peewee-3.0.5/wtfpeewee/tests.py --- old/wtf-peewee-3.0.4/wtfpeewee/tests.py 2022-01-07 19:17:35.000000000 +0100 +++ new/wtf-peewee-3.0.5/wtfpeewee/tests.py 2023-10-25 19:16:06.000000000 +0200 @@ -8,6 +8,7 @@ from wtforms.form import Form as WTForm from wtforms.validators import Regexp from wtfpeewee.fields import * +from wtfpeewee.fields import wtf_choice from wtfpeewee.orm import model_form from wtfpeewee._compat import PY2 @@ -110,6 +111,9 @@ self.entry_a2 = Entry.create(blog=self.blog_a, title='a2', content='a2 content', pub_date=datetime.datetime(2011, 1, 2)) self.entry_b1 = Entry.create(blog=self.blog_b, title='b1', content='b1 content', pub_date=datetime.datetime(2011, 1, 1)) + def assertChoices(self, c, expected): + self.assertEqual(list(c.iter_choices()), [wtf_choice(*i) for i in expected]) + def test_defaults(self): BlogFormDef = model_form(Blog, field_args={'title': {'default': 'hello world'}}) @@ -171,15 +175,17 @@ self.assertTrue(isinstance(form.salutation, SelectChoicesField)) self.assertTrue(isinstance(form.true_or_false, wtfields.BooleanField)) - self.assertEqual(list(form.gender.iter_choices()), [ - ('m', 'Male', False), ('f', 'Female', False) - ]) - self.assertEqual(list(form.status.iter_choices()), [ - ('__None', '----------------', True), (1, 'One', False), (2, 'Two', False) - ]) - self.assertEqual(list(form.salutation.iter_choices()), [ - ('__None', '----------------', True), ('mr', 'Mr.', False), ('mrs', 'Mrs.', False), - ]) + self.assertChoices(form.gender, [ + ('m', 'Male', False), + ('f', 'Female', False)]) + self.assertChoices(form.status, [ + ('__None', '----------------', True), + (1, 'One', False), + (2, 'Two', False)]) + self.assertChoices(form.salutation, [ + ('__None', '----------------', True), + ('mr', 'Mr.', False), + ('mrs', 'Mrs.', False)]) choices_obj = ChoicesModel(gender='m', status=2, salutation=None) form = ChoicesForm(obj=choices_obj) @@ -279,9 +285,9 @@ self.assertEqual(form.blog.data, None) # check that the options look right - self.assertEqual(list(form.blog.iter_choices()), [ - (self.blog_a._pk, u'a', False), (self.blog_b._pk, u'b', False) - ]) + self.assertChoices(form.blog, [ + (self.blog_a._pk, u'a', False), + (self.blog_b._pk, u'b', False)]) def test_blog_form_with_obj(self): form = BlogForm(obj=self.blog_a) @@ -299,9 +305,9 @@ self.assertTrue(form.validate()) # check that the options look right - self.assertEqual(list(form.blog.iter_choices()), [ - (self.blog_a._pk, u'a', True), (self.blog_b._pk, u'b', False) - ]) + self.assertChoices(form.blog, [ + (self.blog_a._pk, u'a', True), + (self.blog_b._pk, u'b', False)]) def test_blog_form_saving(self): form = BlogForm(FakePost({'title': 'new blog'})) @@ -437,24 +443,21 @@ blog = SelectMultipleQueryField(query=Blog.select()) frm = TestForm() - self.assertEqual([x for x in frm.blog.iter_choices()], [ + self.assertChoices(frm.blog, [ (self.blog_a.id, 'a', False), - (self.blog_b.id, 'b', False), - ]) + (self.blog_b.id, 'b', False)]) frm = TestForm(FakePost({'blog': [self.blog_b.id]})) - self.assertEqual([x for x in frm.blog.iter_choices()], [ + self.assertChoices(frm.blog, [ (self.blog_a.id, 'a', False), - (self.blog_b.id, 'b', True), - ]) + (self.blog_b.id, 'b', True)]) self.assertEqual(frm.blog.data, [self.blog_b]) self.assertTrue(frm.validate()) frm = TestForm(FakePost({'blog': [self.blog_b.id, self.blog_a.id]})) - self.assertEqual([x for x in frm.blog.iter_choices()], [ + self.assertChoices(frm.blog, [ (self.blog_a.id, 'a', True), - (self.blog_b.id, 'b', True), - ]) + (self.blog_b.id, 'b', True)]) self.assertEqual(frm.blog.data, [self.blog_a, self.blog_b]) self.assertTrue(frm.validate())
