sol.views
-- Pyramid views¶
- class sol.views.LoggerAdapter(logger, extra=None)¶
Add username and remote IP to the logged message
- process(msg: str, kwargs)¶
Process the logging message and keyword arguments passed in to a logging call to insert contextual information. You can either manipulate the message itself, the keyword args or both. Return the message and kwargs modified (or not) to suit your needs.
Normally, you'll only need to override this one method in a LoggerAdapter subclass for your specific needs.
- sol.views.compute_elapsed_time(since: int | None, max_minutes: int) int | None ¶
Compute elapsed milliseconds since since timestamp, up to max_minutes.
- sol.views.get_request_logger(request, logger)¶
Get a specialized logger for a Pyramid request
- sol.views.json_decode(*args, **kwargs)¶
Custom JSON decoder.
- sol.views.json_encode(*args, **kwargs)¶
Custom JSON encoder.
- sol.views.unauthorized_for_guest(f)¶
Prevent guest users to perform the operation.