From 04d4bbe556fab6a866714d9344efef0a7237a7e8 Mon Sep 17 00:00:00 2001 From: chris t Date: Sun, 19 Jul 2020 15:07:01 -0700 Subject: [PATCH] minor cleanup --- kosokoso.py | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/kosokoso.py b/kosokoso.py index 3f1b26b..a934676 100644 --- a/kosokoso.py +++ b/kosokoso.py @@ -1,12 +1,11 @@ import sqlalchemy as sa -from sqlalchemy.ext.declarative import declarative_base, declared_attr +from sqlalchemy.ext.declarative import declared_attr from sqlalchemy.ext.associationproxy import association_proxy import itertools import logging import pprint import sys -# import traceback # this will get overridden by init_base Base = None @@ -106,17 +105,6 @@ class TagBase(object): def __eq__(self, other): return self.text == other.text - def _get_class_by_tablename(self, tablename): - """Return class reference mapped to table. - - :param tablename: String with name of table. - :return: Class reference or None. - """ - for c in Base._decl_class_registry.values(): - if (hasattr(c, '__tablename__') - and c.__tablename__ == tablename): - return c - class TagAssociationBase(object): __tablename__ = "kk_tag_associations" @@ -202,6 +190,7 @@ class TaggableBase(object): def init_base(new_base): + """Set up classes based on new_base.""" def init_cls(name, base): current = globals()[name + 'Base'] new_ns = current.__dict__.copy()