Permalink
Browse files

Way up 0.3: Fix ListView Headers

  • Loading branch information...
danilogbotelho
danilogbotelho committed Oct 6, 2011
1 parent 88819e4 commit 74b4822f349bf85c561a6bb67bed59e3be9ea37b
Showing with 76 additions and 72 deletions.
  1. +4 −0 HISTORY.txt
  2. +70 −70 setup.py
  3. +2 −2 src/megrok/scaffold/forms.py
View
@@ -1,6 +1,10 @@
Changelog
=========
+0.3
+-----------------
+- List view table now uses field's titles as columns headers
+
0.2
------------------
View
140 setup.py
@@ -1,70 +1,70 @@
-from setuptools import setup, find_packages
-import os
-
-version = '0.2'
-
-def read(*rnames):
- return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
-
-install_requires = [
- 'setuptools',
- 'martian',
- 'grokcore.component',
- 'grokcore.security',
- 'grokcore.view >= 1.12',
- 'grokcore.formlib',
- 'z3c.table >= 0.8',
-]
-
-test_requires = install_requires + [
- 'zope.browserpage',
- 'zope.configuration',
- 'zope.container',
- 'zope.interface',
- 'zope.security',
- 'zope.publisher',
- 'zope.traversing',
- 'zope.testing',
- 'zope.securitypolicy',
- 'zope.principalregistry',
- 'zope.app.wsgi',
- 'grokcore.content',
- 'megrok.layout',
- ]
-
-setup(name='megrok.scaffold',
- version=version,
- description="Auto-generate CRUD forms for a given domain class.",
- long_description=(
- read('src', 'megrok', 'scaffold', 'README.txt')
- + '\n\n' +
- read('HISTORY.txt')
- ),
- # Get more strings from
- # http://pypi.python.org/pypi?:action=list_classifiers
- classifiers=[
- "Programming Language :: Python",
- 'Development Status :: 4 - Beta',
- 'Environment :: Web Environment',
- 'Intended Audience :: Developers',
- 'Natural Language :: English',
- 'Operating System :: OS Independent',
- 'Topic :: Internet :: WWW/HTTP',
- 'Framework :: Zope3'
- ],
- keywords='CRUD form auto model scaffold',
- author='Danilo G. Botelho',
- author_email='danilogbotelho@yahoo.com',
- url='http://pypi.python.org/pypi/megrok.scaffold',
- license='GPL',
- packages=find_packages('src'),
- namespace_packages=['megrok'],
- include_package_data=True,
- package_dir={'': 'src'},
- zip_safe=False,
- install_requires=install_requires,
- extras_require={'test': test_requires},
- entry_points="""
- # -*- Entry points: -*-
- """,
- )
+from setuptools import setup, find_packages
+import os
+
+version = '0.3'
+
+def read(*rnames):
+ return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
+
+install_requires = [
+ 'setuptools',
+ 'martian',
+ 'grokcore.component',
+ 'grokcore.security',
+ 'grokcore.view >= 1.12',
+ 'grokcore.formlib',
+ 'z3c.table >= 0.8',
+]
+
+test_requires = install_requires + [
+ 'zope.browserpage',
+ 'zope.configuration',
+ 'zope.container',
+ 'zope.interface',
+ 'zope.security',
+ 'zope.publisher',
+ 'zope.traversing',
+ 'zope.testing',
+ 'zope.securitypolicy',
+ 'zope.principalregistry',
+ 'zope.app.wsgi',
+ 'grokcore.content',
+ 'megrok.layout',
+ ]
+
+setup(name='megrok.scaffold',
+ version=version,
+ description="Auto-generate CRUD forms for a given domain class.",
+ long_description=(
+ read('src', 'megrok', 'scaffold', 'README.txt')
+ + '\n\n' +
+ read('HISTORY.txt')
+ ),
+ # Get more strings from
+ # http://pypi.python.org/pypi?:action=list_classifiers
+ classifiers=[
+ "Programming Language :: Python",
+ 'Development Status :: 4 - Beta',
+ 'Environment :: Web Environment',
+ 'Intended Audience :: Developers',
+ 'Natural Language :: English',
+ 'Operating System :: OS Independent',
+ 'Topic :: Internet :: WWW/HTTP',
+ 'Framework :: Zope3'
+ ],
+ keywords='CRUD form auto model scaffold',
+ author='Danilo G. Botelho',
+ author_email='danilogbotelho@yahoo.com',
+ url='http://pypi.python.org/pypi/megrok.scaffold',
+ license='GPL',
+ packages=find_packages('src'),
+ namespace_packages=['megrok'],
+ include_package_data=True,
+ package_dir={'': 'src'},
+ zip_safe=False,
+ install_requires=install_requires,
+ extras_require={'test': test_requires},
+ entry_points="""
+ # -*- Entry points: -*-
+ """,
+ )
@@ -331,7 +331,7 @@ def setUpColumns(self):
BaseColumn = table.column.GetAttrColumn
class GetFieldColumn(BaseColumn):
attrName = field_name
- cols.append(table.column.addColumn(self, GetFieldColumn, field_name, header=field_name.capitalize()))
+ cols.append(table.column.addColumn(self, GetFieldColumn, field_name, header=field.field.title))
return cols
@property
@@ -350,4 +350,4 @@ def getEditURL(self, item):
class PageListForm(ListForm, layout.Form):
aspage = True
-
+

0 comments on commit 74b4822

Please sign in to comment.