From d358c5fed0a37dbe5ef8bd4e13f9a7150e74dd9e Mon Sep 17 00:00:00 2001 From: Nishant Nawarkhede Date: Wed, 23 Oct 2024 16:26:24 +0530 Subject: [PATCH 1/2] python and flask upgrade --- README.md | 2 +- examples/sortable.py | 3 +- flask_table/columns.py | 3 +- flask_table/html.py | 2 +- flask_table/table.py | 2 +- my.ptach | 83 ++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 90 insertions(+), 5 deletions(-) create mode 100644 my.ptach diff --git a/README.md b/README.md index 55aed22..393a5e2 100644 --- a/README.md +++ b/README.md @@ -354,7 +354,7 @@ If you need access to all of information in the item, then we can go a stage earlier in the process and override the td_contents method: ```python -from flask import Markup +from markupsafe import Markup def td_contents(self, i, attr_list): # by default this does diff --git a/examples/sortable.py b/examples/sortable.py index e94d7ba..3bc2fb1 100644 --- a/examples/sortable.py +++ b/examples/sortable.py @@ -1,5 +1,6 @@ from flask_table import Table, Col, LinkCol -from flask import Flask, Markup, request, url_for +from flask import Flask, request, url_for +from markupsafe import Markup """ A example for creating a Table that is sortable by its header diff --git a/flask_table/columns.py b/flask_table/columns.py index fc74d24..5ae1558 100644 --- a/flask_table/columns.py +++ b/flask_table/columns.py @@ -1,6 +1,7 @@ from __future__ import unicode_literals -from flask import Markup, url_for +from flask import url_for +from markupsafe import Markup from babel.dates import format_date, format_datetime from flask_babel import gettext as _ diff --git a/flask_table/html.py b/flask_table/html.py index f9ca78b..9edb87a 100644 --- a/flask_table/html.py +++ b/flask_table/html.py @@ -2,7 +2,7 @@ from __future__ import unicode_literals from functools import partial -from flask import Markup +from markupsafe import Markup def element(element, attrs=None, content='', diff --git a/flask_table/table.py b/flask_table/table.py index 9495e6e..a70324e 100644 --- a/flask_table/table.py +++ b/flask_table/table.py @@ -2,7 +2,7 @@ from __future__ import unicode_literals from collections import OrderedDict -from flask import Markup +from markupsafe import Markup from flask_babel import gettext as _ from .columns import Col diff --git a/my.ptach b/my.ptach new file mode 100644 index 0000000..75b8efb --- /dev/null +++ b/my.ptach @@ -0,0 +1,83 @@ +From 83a21226e022267a347e8f44de39cb04c15bc64e Mon Sep 17 00:00:00 2001 +From: Nishant Nawarkhede +Date: Wed, 23 Oct 2024 16:06:41 +0530 +Subject: [PATCH] Fix: Update import statements to resolve Markup import error + +- Changed import of Markup from flask to markupsafe in flask_table and flask_wtf packages +- Ensured compatibility with the latest Flask version +--- + README.md | 2 +- + examples/sortable.py | 3 ++- + flask_table/columns.py | 3 ++- + flask_table/html.py | 2 +- + flask_table/table.py | 2 +- + 5 files changed, 7 insertions(+), 5 deletions(-) + +diff --git a/README.md b/README.md +index 55aed22..393a5e2 100644 +--- a/README.md ++++ b/README.md +@@ -354,7 +354,7 @@ If you need access to all of information in the item, then we can go a + stage earlier in the process and override the td_contents method: + + ```python +-from flask import Markup ++from markupsafe import Markup + + def td_contents(self, i, attr_list): + # by default this does +diff --git a/examples/sortable.py b/examples/sortable.py +index e94d7ba..3bc2fb1 100644 +--- a/examples/sortable.py ++++ b/examples/sortable.py +@@ -1,5 +1,6 @@ + from flask_table import Table, Col, LinkCol +-from flask import Flask, Markup, request, url_for ++from flask import Flask, request, url_for ++from markupsafe import Markup + + """ + A example for creating a Table that is sortable by its header +diff --git a/flask_table/columns.py b/flask_table/columns.py +index fc74d24..5ae1558 100644 +--- a/flask_table/columns.py ++++ b/flask_table/columns.py +@@ -1,6 +1,7 @@ + from __future__ import unicode_literals + +-from flask import Markup, url_for ++from flask import url_for ++from markupsafe import Markup + from babel.dates import format_date, format_datetime + from flask_babel import gettext as _ + +diff --git a/flask_table/html.py b/flask_table/html.py +index f9ca78b..9edb87a 100644 +--- a/flask_table/html.py ++++ b/flask_table/html.py +@@ -2,7 +2,7 @@ + from __future__ import unicode_literals + from functools import partial + +-from flask import Markup ++from markupsafe import Markup + + + def element(element, attrs=None, content='', +diff --git a/flask_table/table.py b/flask_table/table.py +index 9495e6e..a70324e 100644 +--- a/flask_table/table.py ++++ b/flask_table/table.py +@@ -2,7 +2,7 @@ + from __future__ import unicode_literals + from collections import OrderedDict + +-from flask import Markup ++from markupsafe import Markup + from flask_babel import gettext as _ + + from .columns import Col +-- +2.34.1 + + From e87bc460fa0ec9aa3a11c9344f2d492e8cf20977 Mon Sep 17 00:00:00 2001 From: Nishant Nawarkhede Date: Wed, 23 Oct 2024 16:27:07 +0530 Subject: [PATCH 2/2] removed patch file from repo --- my.ptach | 83 -------------------------------------------------------- 1 file changed, 83 deletions(-) delete mode 100644 my.ptach diff --git a/my.ptach b/my.ptach deleted file mode 100644 index 75b8efb..0000000 --- a/my.ptach +++ /dev/null @@ -1,83 +0,0 @@ -From 83a21226e022267a347e8f44de39cb04c15bc64e Mon Sep 17 00:00:00 2001 -From: Nishant Nawarkhede -Date: Wed, 23 Oct 2024 16:06:41 +0530 -Subject: [PATCH] Fix: Update import statements to resolve Markup import error - -- Changed import of Markup from flask to markupsafe in flask_table and flask_wtf packages -- Ensured compatibility with the latest Flask version ---- - README.md | 2 +- - examples/sortable.py | 3 ++- - flask_table/columns.py | 3 ++- - flask_table/html.py | 2 +- - flask_table/table.py | 2 +- - 5 files changed, 7 insertions(+), 5 deletions(-) - -diff --git a/README.md b/README.md -index 55aed22..393a5e2 100644 ---- a/README.md -+++ b/README.md -@@ -354,7 +354,7 @@ If you need access to all of information in the item, then we can go a - stage earlier in the process and override the td_contents method: - - ```python --from flask import Markup -+from markupsafe import Markup - - def td_contents(self, i, attr_list): - # by default this does -diff --git a/examples/sortable.py b/examples/sortable.py -index e94d7ba..3bc2fb1 100644 ---- a/examples/sortable.py -+++ b/examples/sortable.py -@@ -1,5 +1,6 @@ - from flask_table import Table, Col, LinkCol --from flask import Flask, Markup, request, url_for -+from flask import Flask, request, url_for -+from markupsafe import Markup - - """ - A example for creating a Table that is sortable by its header -diff --git a/flask_table/columns.py b/flask_table/columns.py -index fc74d24..5ae1558 100644 ---- a/flask_table/columns.py -+++ b/flask_table/columns.py -@@ -1,6 +1,7 @@ - from __future__ import unicode_literals - --from flask import Markup, url_for -+from flask import url_for -+from markupsafe import Markup - from babel.dates import format_date, format_datetime - from flask_babel import gettext as _ - -diff --git a/flask_table/html.py b/flask_table/html.py -index f9ca78b..9edb87a 100644 ---- a/flask_table/html.py -+++ b/flask_table/html.py -@@ -2,7 +2,7 @@ - from __future__ import unicode_literals - from functools import partial - --from flask import Markup -+from markupsafe import Markup - - - def element(element, attrs=None, content='', -diff --git a/flask_table/table.py b/flask_table/table.py -index 9495e6e..a70324e 100644 ---- a/flask_table/table.py -+++ b/flask_table/table.py -@@ -2,7 +2,7 @@ - from __future__ import unicode_literals - from collections import OrderedDict - --from flask import Markup -+from markupsafe import Markup - from flask_babel import gettext as _ - - from .columns import Col --- -2.34.1 - -