wuttaweb.views.alembic

Views for Alembic

class wuttaweb.views.alembic.AlembicDashboardView(request, context=None)[source]

Custom views for the Alembic Dashboard.

dashboard()[source]

Main view for the Alembic Dashboard.

Route name is alembic.dashboard; URL is /alembic/dashboard

migrate()[source]

Action view to migrate the database. POST request must be used.

This directly invokes the alembic upgrade (or alembic downgrade) command.

It then sets a flash message per the command status, and redirects user back to the Dashboard (or other referrer).

The request must specify a revspec param, which we pass along as-is to the alembic command. We assume alembic upgrade unless the request sets direction param to "downgrade".

class wuttaweb.views.alembic.AlembicMigrationView(request, context=None)[source]

Master view for Alembic Migrations.

Route prefix is alembic.migrations; notable URLs include:

  • /alembic/migrations/

  • /alembic/migrations/new

  • /alembic/migrations/XXX