File: base.py

package info (click to toggle)
python-django-timezone-field 7.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 292 kB
  • sloc: python: 1,047; sh: 6; makefile: 3
file content (19 lines) | stat: -rw-r--r-- 313 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from abc import ABC, abstractmethod


class TimeZoneNotFoundError(Exception):
    pass


class TimeZoneBackend(ABC):
    utc_tzobj = None
    all_tzstrs = None
    base_tzstrs = None

    @abstractmethod
    def is_tzobj(self, value):
        pass

    @abstractmethod
    def to_tzobj(self, tzstr):
        pass