common.utils package¶
Submodules¶
common.utils.conversions module¶
common.utils.db module¶
Helpers for working with the DB.
All of these expect to be passed a records.Database wrapping a psycopg2 connection.
-
class
common.utils.db.
Notify
(channel, payload)¶ Bases:
tuple
-
__getnewargs__
()¶ Return self as a plain tuple. Used by copy and pickle.
-
__getstate__
()¶ Exclude the OrderedDict from pickling
-
static
__new__
(_cls, channel, payload)¶ Create new instance of Notify(channel, payload)
-
__repr__
()¶ Return a nicely formatted representation string
-
channel
¶ Alias for field number 0
-
payload
¶ Alias for field number 1
-
common.utils.logging module¶
-
class
common.utils.logging.
Formatter
(fmt=None, datefmt=None, style='%')[source]¶ Bases:
logging.Formatter
Deadlock-friendly formatter for logging. It likes to shorten things.
Changes from logging.Formatter:
- strips first name component from logger name, as it is redundant in both prod and devel config