[python-tgfastdata] A few more fixes to stuff that doesn't work with current TG
Toshio くらとみ
toshio at fedoraproject.org
Sat Jul 16 17:49:57 UTC 2011
commit c4444c43a85275abac8eed517c2ccd8163ac0115
Author: Toshio Kuratomi <toshio at fedoraproject.org>
Date: Sat Jul 16 10:49:25 2011 -0700
A few more fixes to stuff that doesn't work with current TG
python-tgfastdata.spec | 6 +++-
tgfastdata-template-engine.patch | 51 ++++++++++++++++++++++++++++++++++++++
tgfastdata-tg1.1-unittest.patch | 22 ++++++++++++++++
3 files changed, 78 insertions(+), 1 deletions(-)
---
diff --git a/python-tgfastdata.spec b/python-tgfastdata.spec
index bede31c..69725b3 100644
--- a/python-tgfastdata.spec
+++ b/python-tgfastdata.spec
@@ -17,6 +17,8 @@ Source0: http://pypi.python.org/packages/source/T/%{srcname}/%{srcname}-0.9a7.zi
Patch0: tgfastdata-requires.patch
Patch1: tgfastdata-date-widget-fix.patch
Patch2: tgfastdata-foreign-key-unittest.patch
+Patch3: tgfastdata-template-engine.patch
+Patch4: tgfastdata-tg1.1-unittest.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
@@ -37,6 +39,8 @@ interface generation based upon an application's model objects.
%patch0 -p1 -b .deps
%patch1 -p1 -b .dw
%patch2 -p1 -b .fk
+%patch3 -p1 -b .tmple
+%patch4 -p1 -b .tg1.1
%build
%{__python} setup.py build
@@ -46,7 +50,7 @@ rm -rf %{buildroot}
%{__python} setup.py install --skip-build --root %{buildroot}
%check
-%{__python} setup.py test
+PYTHONPATH=$(pwd) %{__python} setup.py test
%clean
rm -rf %{buildroot}
diff --git a/tgfastdata-template-engine.patch b/tgfastdata-template-engine.patch
new file mode 100644
index 0000000..93bff27
--- /dev/null
+++ b/tgfastdata-template-engine.patch
@@ -0,0 +1,51 @@
+Index: TGFastData-0.9a7/tgfastdata/datacontroller.py
+===================================================================
+--- TGFastData-0.9a7.orig/tgfastdata/datacontroller.py
++++ TGFastData-0.9a7/tgfastdata/datacontroller.py
+@@ -247,9 +247,9 @@ class DataController(BaseDataController)
+ """Provides basic add/edit/delete capability"""
+ list_widget = FastDataGrid()
+ form_widget_class = EditForm
+- form_template = "tgfastdata.templates.form"
+- list_template = "tgfastdata.templates.list"
+- item_template = "tgfastdata.templates.item"
++ form_template = "kid:tgfastdata.templates.form"
++ list_template = "kid:tgfastdata.templates.list"
++ item_template = "kid:tgfastdata.templates.item"
+ form_fields = None
+ list_fields = None
+ object_name = 'Record'
+Index: TGFastData-0.9a7/tgfastdata/datawidgets.py
+===================================================================
+--- TGFastData-0.9a7.orig/tgfastdata/datawidgets.py
++++ TGFastData-0.9a7/tgfastdata/datawidgets.py
+@@ -10,6 +10,7 @@ from turbogears.database import so_colum
+
+ class EditForm(widgets.TableForm):
+ template = 'tgfastdata.templates.editform'
++ engine_name = 'kid'
+
+ class FastDataGrid(DataGrid):
+ """Grid that displays SQLObject's SelectResults with add/edit/delete controls.
+@@ -17,6 +18,7 @@ class FastDataGrid(DataGrid):
+
+ css = [widgets.CSSLink(widgets.static, "grid.css")]
+ template = "tgfastdata.templates.datagrid"
++ engine_name = "kid"
+ params = ["show_actions", "show_add_link", "add_link_title",
+ "delete_link_msg", "get_edit_url", "get_delete_url",
+ "get_add_url"]
+Index: TGFastData-0.9a7/tgfastdata/tests/test_fastdata.py
+===================================================================
+--- TGFastData-0.9a7.orig/tgfastdata/tests/test_fastdata.py
++++ TGFastData-0.9a7/tgfastdata/tests/test_fastdata.py
+@@ -16,7 +16,8 @@ FakeUser.createTable()
+
+ class TestFastDataGrid:
+ def setup(self):
+- self.grid = FastDataGrid(template = "tgfastdata.templates.datagrid")
++ self.grid = FastDataGrid(template = "tgfastdata.templates.datagrid",
++ engine_name="kid")
+ def test_dynamic_fields(self):
+ fields = [
+ 'userId',
diff --git a/tgfastdata-tg1.1-unittest.patch b/tgfastdata-tg1.1-unittest.patch
new file mode 100644
index 0000000..2da250d
--- /dev/null
+++ b/tgfastdata-tg1.1-unittest.patch
@@ -0,0 +1,22 @@
+Index: TGFastData-0.9a7/tgfastdata/tests/test_fastdata.py
+===================================================================
+--- TGFastData-0.9a7.orig/tgfastdata/tests/test_fastdata.py
++++ TGFastData-0.9a7/tgfastdata/tests/test_fastdata.py
+@@ -29,7 +29,7 @@ class TestFastDataGrid:
+ d = dict(value=sr, fields=fields)
+ self.grid.update_params(d)
+ get_field = d['get_field']
+- assert ['userId', 'displayName', 'column-2', 'column-3'] == d['collist']
++ assert ['userId', 'displayName', 'column-2', 'column-3'] == [c.name for c in d['columns']]
+ row = FakeUser(userId=123, name='john')
+ assert 123 == get_field(row, 'userId')
+ assert 'John' == get_field(row, 'displayName')
+@@ -40,7 +40,7 @@ class TestFastDataGrid:
+ d = dict(value=sr)
+ self.grid.update_params(d)
+ get_field = d['get_field']
+- assert ['userId', 'name'] == d['collist']
++ assert ['userId', 'name'] == [c.name for c in d['columns']]
+ row = FakeUser(userId=123, name='john')
+ assert 123 == get_field(row, 'userId')
+ assert 'john' == get_field(row, 'name')
More information about the scm-commits
mailing list