/tutorial

Pyramid's "SQLAlchemy + URL dispatch" tutorial scaffold based on Poetry

Primary LanguagePython

Pyramid's "SQLAlchemy + URL dispatch" tutorial scaffold based on Poetry

An example "tutorial" repo that follows https://docs.pylonsproject.org/projects/pyramid/en/latest/tutorials/wiki2/index.html but uses Poetry instead of pip/setuptools.

Using latest Pyramid 2 and SQLAlchemy 2.

These are the commands used in the tutorial, but changed to use Poetry:

$ cd ~
$ git clone https://github.com/zupo/tutorial.git
$ cd tutorial
$ poetry install
$ poetry run alembic -c development.ini revision --autogenerate -m "init"
$ poetry run alembic -c development.ini upgrade head
$ poetry run initialize_tutorial_db development.ini
$ poetry run pytest -q
$ poetry run pserve development.ini --reload

Nix support

If you want to skip the manual installation of prerequisites, this repo comes with Nix support as well. Assuming you have Nix & direnv installed (but no Python, no Poetry, etc.), the commands above look like so:

$ cd ~
$ git clone https://github.com/zupo/tutorial.git
$ cd tutorial
$ alembic -c development.ini revision --autogenerate -m "init"
$ alembic -c development.ini upgrade head
$ initialize_tutorial_db development.ini
$ pytest -q
$ pserve development.ini --reload

Object history via SQLAlchemy-Continuum

Need to keep history of your objects so you can tell who changed what and when? See the exploration/sqlalchemy-continuum branch of this repo.

Worflows for SQLAlchemy models

Need Plone/Kotty/repoze_workflow style Finite-State-Machine support for your models?? See the exploration/sqlalchemy-fsm branch of this repo.

References