diff options
Diffstat (limited to 'python/report_ops/admin.py')
| -rw-r--r-- | python/report_ops/admin.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/python/report_ops/admin.py b/python/report_ops/admin.py index 337cc73b..05269659 100644 --- a/python/report_ops/admin.py +++ b/python/report_ops/admin.py @@ -26,16 +26,21 @@ class CitcoReport: _conn: dbconn = dbconn("dawndb") date_cols: List[str] = [] dtkey_fun: ClassVar + _registry = {} def __init_subclass__(cls, table, fname, date_cols, dtkey): cls.table = table cls.fname = fname cls.date_cols = date_cols cls.dtkey_fun = partial(dt_from_citco, file_tag=cls.fname, dt_format=dtkey) + cls._registry[table] = cls def __init__(self, date): self.date = date + def __class_getitem__(cls, table): + return cls._registry[table] + @classmethod def get_newest_report(cls, date): p = max( |
