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(oralembic 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
revspecparam, which we pass along as-is to thealembiccommand. We assumealembic upgradeunless the request setsdirectionparam to"downgrade".