autodonate.models#

Models for our project.

Module Contents#

Classes#

Config

Configuration model for the application.

class Config(*args, **kwargs)[source]#

Bases: django.db.models.Model

Configuration model for the application.

key :str[source]#
value :str[source]#
classmethod get(cls, key: str) Any[source]#

Get row from DB.

Parameters

key – The key of the row.

Returns

Decoded ubjson string.

Raises

Config.DoesNotExist – Raised when row does not exist.

classmethod set(cls, key: str, value: Any) None[source]#

Set (or create) config row in DB.

Parameters
  • key – The key of the row.

  • value – The value of the row. Can be any type which can understand ubjson.

__str__(self) str[source]#

Nice representation in admin panel.

Returns

Config.key.