add documentation

This commit is contained in:
Andrew Mleczko
2011-06-17 12:48:34 +02:00
parent f995acc622
commit 92a1821598
+27 -1
View File
@@ -53,7 +53,7 @@ Custom view, factory, forms
In the toward examples we just pass a ``package`` parameter to
:func:`~pyramid_formalchemy.configure`. By default the function will try to
load ``package.models`` ``package.models.DBSession`` and ``package.forms`` but
load ``package.models``, ``package.models.DBSession`` and ``package.forms`` but
you can override this. In this case you don't need to specify a package::
@@ -72,6 +72,32 @@ Having fun with the query_factory parameter
.. literalinclude:: ../../formalchemy_project/__init__.py
:pyobject: main
Custom views per model
----------------------
You can also register custom CRUD views per ModelListing::
config.formalchemy_model_view('admin',
model='pyramidapp.models.Foo',
context='pyramid_formalchemy.resources.ModelListing',
renderer='templates/foolisting.pt',
attr='listing',
request_method='GET',
permission='view')
and per Model::
config.formalchemy_model_view('admin',
model='pyramidapp.models.Foo',
context='pyramid_formalchemy.resources.Model',
name='',
renderer='templates/fooshow.pt',
attr='show',
request_method='GET',
permission='view')
Setting permissions
===================