-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
88 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
Arcitecture | ||
=========== | ||
|
||
Main page | ||
--------- | ||
|
||
He takes all the resources of the settings to return them to the template | ||
``home.jinja2``. It implemented in :func:`pyramid_sacrud.views.sa_home`. | ||
|
||
.. figure:: /_static/pencil/home_how_it_works.png | ||
|
||
List of rows | ||
------------ | ||
|
||
He takes all rows of resource, paginate it and return to template ``list.jinja2``. | ||
It implemented in :class:`pyramid_sacrud.views.CRUD.List`. For select action | ||
used :mod:`sacrud` and :meth:`sacrud.action.CRUD.read`. | ||
|
||
.. figure:: /_static/pencil/read_how_it_works.png | ||
|
||
Delete row | ||
---------- | ||
|
||
He delete selected row and redirect to list of rows. It implemented in | ||
:class:`pyramid_sacrud.views.CRUD.Delete`. For delete action used :mod:`sacrud` | ||
and :meth:`sacrud.action.CRUD.delete`. | ||
|
||
.. figure:: /_static/pencil/delete_how_it_works.png | ||
|
||
Form for CREATE/DELETE action | ||
----------------------------- | ||
|
||
If you send GET request it return HTML form for your module. To generate form | ||
it used :mod:`sacrud_deform`. `sacrud_deform` generate form with schema from | ||
:mod:`ColanderAlchemy` and widgets from :mod:`deform`. The main task of | ||
:mod:`sacrud_deform` is choose the right widgets from :mod:`deform` and make | ||
select widget for relationships. It implemented in | ||
:class:`pyramid_sacrud.views.CRUD.Add` and used template ``create.jinja2``. | ||
|
||
.. figure:: /_static/pencil/add_how_it_works.png | ||
|
||
POST request for CREATE/DELETE action | ||
------------------------------------- | ||
|
||
If you send POST request it validate form and do create/update action from | ||
:mod:`sacrud` respectively :meth:`sacrud.action.CRUD.create` and | ||
:meth:`sacrud.action.CRUD.update`. It implemented in | ||
:class:`pyramid_sacrud.views.CRUD.Add`. | ||
|
||
.. figure:: /_static/pencil/add_post_how_it_works.png | ||
|
||
Future generation | ||
----------------- | ||
|
||
Everything is good, but it does not allow use tree structure of resources and | ||
has hard depency from :mod:`SQLAlchemy`, :mod:`sacrud`, :mod:`sacrud_deform` | ||
etc... This is not good, a new generation of :mod:`pyramid_sacrud` must | ||
represent just interface for any backends, like: | ||
|
||
* ziggfrom_alchemy - handle SQLAlchemy resourse | ||
* ziggfrom_peewee - handle PeeweeORM resourse | ||
* ziggfrom_ponyorm - handle PonyORM resourse | ||
* ziggfrom_djangoorm - handle Django ORM resourse | ||
* ziggfrom_mongodb - handle MongoDB resourse | ||
* and unniversal interface writing your own backends for example: | ||
|
||
* you can write filesystem backend which shown files in | ||
:mod:`pyramid_sacrud` and provide to you CRUD operations. | ||
* OS process backend shown process in :mod:`pyramid_sacrud` and allow to kill it | ||
* and all you can come to mind. | ||
|
||
ziggform_* - it's abstract modules, this is what needs to be done. I like the | ||
idea of `ziggurat_form <https://github.com/ergo/ziggurat_form>`_ so I use such | ||
names. | ||
|
||
.. figure:: /_static/pencil/new_architecture.png | ||
|
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Contribute | ||
========== | ||
|
||
.. toctree:: | ||
:maxdepth: 3 | ||
|
||
architecture.rst | ||
backend.rst | ||
frontend.rst | ||
localization.rst |
File renamed without changes.