New Architecture

Old Architecture is good, but it does not allow use tree structure of resources and has hard depency from SQLAlchemy, sacrud, sacrud_deform etc... This is not flexible solution. A new generation of pyramid_sacrud >= 0.3.0 represent just interface for any backends, like:

  • ps_alchemy - handle SQLAlchemy resourse
  • ps_peewee - handle PeeweeORM resourse
  • ps_ponyorm - handle PonyORM resourse
  • ps_djangoorm - handle Django ORM resourse
  • ps_mongodb - handle MongoDB resourse
  • and unniversal interface writing your own backends for example:
    • you can write filesystem backend which shown files in pyramid_sacrud and provide to you CRUD operations.
    • OS process backend shown process in 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 so I use such names.

../../_images/new_architecture.png

Old Architecture

Main page

He takes all the resources of the settings to return them to the template home.jinja2. It implemented in pyramid_sacrud.views.sa_home().

../../_images/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 pyramid_sacrud.views.CRUD.List. For select action used sacrud and sacrud.action.CRUD.read().

../../_images/read_how_it_works.png

Delete row

He delete selected row and redirect to list of rows. It implemented in pyramid_sacrud.views.CRUD.Delete. For delete action used sacrud and sacrud.action.CRUD.delete().

../../_images/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 sacrud_deform. sacrud_deform generate form with schema from ColanderAlchemy and widgets from deform. The main task of sacrud_deform is choose the right widgets from deform and make select widget for relationships. It implemented in pyramid_sacrud.views.CRUD.Add and used template create.jinja2.

../../_images/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 sacrud respectively sacrud.action.CRUD.create() and sacrud.action.CRUD.update(). It implemented in pyramid_sacrud.views.CRUD.Add.

../../_images/add_post_how_it_works.png
  Read the Docs
v: latest  
Versions
latest
stable
master
Free document hosting provided by Read the Docs.