arxiv.submission.services.classic.util module

Utility classes and functions for services.classic.

class arxiv.submission.services.classic.util.ClassicSQLAlchemy(app=None, use_native_unicode=True, session_options=None, metadata=None, query_class=<class 'flask_sqlalchemy.BaseQuery'>, model_class=<class 'flask_sqlalchemy.model.Model'>, engine_options=None)[source]

Bases: flask_sqlalchemy.SQLAlchemy

SQLAlchemy integration for the classic database.

apply_pool_defaults(app, options)[source]

Set options for create_engine().

init_app(app)[source]

Set default configuration.

Return type

None

class arxiv.submission.services.classic.util.SQLiteJSON(*args, **kwargs)[source]

Bases: sqlalchemy.sql.type_api.TypeDecorator

A SQLite-friendly JSON data type.

impl

alias of sqlalchemy.sql.sqltypes.TEXT

process_bind_param(value, dialect)[source]

Serialize a dict to JSON.

Return type

str

process_result_value(value, dialect)[source]

Deserialize JSON content to a dict.

Return type

Optional[dict]

arxiv.submission.services.classic.util.current_engine()[source]

Get/create Engine for this context.

Return type

Engine

arxiv.submission.services.classic.util.current_session()[source]

Get/create Session for this context.

Return type

Session

arxiv.submission.services.classic.util.transaction()[source]

Context manager for database transaction.

Return type

Generator[+T_co, -T_contra, +V_co]