[Checkins] SVN: megrok.traject/trunk/ Preparing for release.
Martijn Faassen
faassen at startifact.com
Mon Nov 16 07:15:27 EST 2009
Log message for revision 105703:
Preparing for release.
Changed:
U megrok.traject/trunk/CHANGES.txt
A megrok.traject/trunk/README.txt
U megrok.traject/trunk/buildout.cfg
U megrok.traject/trunk/setup.py
U megrok.traject/trunk/src/megrok/traject/__init__.py
-=-
Modified: megrok.traject/trunk/CHANGES.txt
===================================================================
--- megrok.traject/trunk/CHANGES.txt 2009-11-16 11:46:00 UTC (rev 105702)
+++ megrok.traject/trunk/CHANGES.txt 2009-11-16 12:15:27 UTC (rev 105703)
@@ -1,3 +1,9 @@
CHANGES.txt
-===========
+***********
+0.9 (unreleased)
+================
+
+* Initial public release.
+
+
Added: megrok.traject/trunk/README.txt
===================================================================
--- megrok.traject/trunk/README.txt (rev 0)
+++ megrok.traject/trunk/README.txt 2009-11-16 12:15:27 UTC (rev 105703)
@@ -0,0 +1,55 @@
+megrok.traject
+**************
+
+``megrok.traject`` is a library that integrates the traject_ routing
+framework with the Grok_ web framework.
+
+.. _traject: http://pypi.python.org/pypi/traject
+
+.. _grok: http://grok.zope.org
+
+Include ``megrok.traject`` by adding it in your Grok project's
+``setup.py`` (in ``install_requires``) and re-running buildout.
+
+With ``megrok.traject`` you can declare trajects in Grok like this::
+
+ from megrok import traject
+
+ class SomeTraject(traject.Traject):
+ grok.context(App)
+
+ pattern = 'departments/:department_id'
+ model = Department
+
+ def factory(department_id):
+ return get_department(department_id)
+
+ def arguments(department):
+ return dict(department_id=department.id)
+
+This registers ``factory`` and the inverse ``arguments`` functions for
+the pattern ``departments/:department_id``, the root ``App`` and the
+class ``Department``. This replaces the ``register*`` functions in
+traject itself.
+
+``App`` is any grok model. This model now automatically allows
+traversal into the associated patterns; the system registers a custom
+traverser to do this.
+
+You can register grok views for ``Department`` as usual.
+
+Tips:
+
+* return ``None`` in factory if the model cannot be found. The system
+ then falls back to normal traversal to look up the view. Being too
+ aggressive in consuming any arguments will break view traversal.
+
+* Use ``megrok.traject.locate`` to locate an object before asking for
+ its URL or doing ``checkPermission`` on it. If the object was routed
+ to using ``megrok.traject`` already this isn't necessary. This is
+ a simple import alias for ``traject.locate``.
+
+For more information see the traject_ documentation.
+
+.. _traject: http://pypi.python.org/pypi/traject
+
Modified: megrok.traject/trunk/buildout.cfg
===================================================================
--- megrok.traject/trunk/buildout.cfg 2009-11-16 11:46:00 UTC (rev 105702)
+++ megrok.traject/trunk/buildout.cfg 2009-11-16 12:15:27 UTC (rev 105703)
@@ -1,8 +1,7 @@
[buildout]
-develop = . ../traject
+develop = .
parts = test
-find-links = http://download.zope.org/distribution/
-extends = http://grok.zope.org/releaseinfo/grok-1.0a4.cfg
+extends = http://grok.zope.org/releaseinfo/grok-1.0.cfg
versions = versions
[test]
Modified: megrok.traject/trunk/setup.py
===================================================================
--- megrok.traject/trunk/setup.py 2009-11-16 11:46:00 UTC (rev 105702)
+++ megrok.traject/trunk/setup.py 2009-11-16 12:15:27 UTC (rev 105703)
@@ -1,18 +1,25 @@
import os
from setuptools import setup, find_packages
-version = '0.1dev'
-
def read(*filenames):
return open(os.path.join(os.path.dirname(__file__), *filenames)).read()
+long_description = (
+ read('README.txt')
+ + '\n' +
+ read('CHANGES.txt')
+ + '\n' +
+ 'Download\n'
+ '********\n'
+ )
+
setup(name='megrok.traject',
- version=version,
+ version='0.9dev',
description="Traject integration for Grok applications",
-
+ long_description=long_description,
# Use classifiers that are already listed at:
# http://pypi.python.org/pypi?%3Aaction=list_classifiers
- classifiers=['Development Status :: 5 - Production/Stable',
+ classifiers=['Development Status :: 4 - Beta',
'Environment :: Web Environment',
'Framework :: Zope3',
'Intended Audience :: Developers',
Modified: megrok.traject/trunk/src/megrok/traject/__init__.py
===================================================================
--- megrok.traject/trunk/src/megrok/traject/__init__.py 2009-11-16 11:46:00 UTC (rev 105702)
+++ megrok.traject/trunk/src/megrok/traject/__init__.py 2009-11-16 12:15:27 UTC (rev 105703)
@@ -15,4 +15,4 @@
"""megrok.traject - URL routing for Grok
"""
from megrok.traject.components import Traject
-
+from traject import locate
More information about the checkins
mailing list