ORM related services.
Bases: sqlalchemy.sql.expression.ClauseList
Custom clause list for ORDER BY clauses.
Suppresses the grouping parentheses which would trigger a syntax error.
The scoped session maker. Instantiate this to obtain a thread local session instance.
Converts the given instrumented string attribute into an SQL expression that can be used as a slug.
Slugs are identifiers for members in a collection that can be used in an URL. We create slug columns by replacing non-URL characters with dashes and lower casing the result. We need this at the ORM level so that we can use the slug in a query expression.
Clears all mappers set up by SA and also clears all custom “id” and “slug” attributes inserted by the mapper() function in this module.
This should only ever bee needed in a testing context.
Strict commit veto to use with the transaction manager.
Unlike the default commit veto supplied with the transaction manager, this will veto all commits for HTTP status codes other than 2xx unless a commit is explicitly requested by setting the “x-tm” response header to “commit”.
Convenience wrapper around the SA mapper which will set up the hybrid “id” and “slug” attributes required by everest after calling the SA mapper.
If you (e.g., for testing purposes) want to clear mappers created with this function, use the clear_mappers() function in this module.
Parameters: |
|
---|