Changeset View
Changeset View
Standalone View
Standalone View
swh/lister/core/models.py
# Copyright (C) 2015-2017 the Software Heritage developers | # Copyright (C) 2015-2017 the Software Heritage developers | ||||
# License: GNU General Public License version 3, or any later version | # License: GNU General Public License version 3, or any later version | ||||
# See top-level LICENSE file for more information | # See top-level LICENSE file for more information | ||||
import abc | import abc | ||||
from datetime import datetime | from datetime import datetime | ||||
import logging | import logging | ||||
from sqlalchemy import Column, DateTime, Integer, String | from sqlalchemy import Column, DateTime, Integer, String | ||||
from sqlalchemy.ext.declarative import declarative_base, DeclarativeMeta | from sqlalchemy.ext.declarative import DeclarativeMeta | ||||
from .abstractattribute import AbstractAttribute | from .abstractattribute import AbstractAttribute | ||||
logger = logging.getLogger(__name__) | from swh.storage.schemata.distribution import SQLBase | ||||
SQLBase = declarative_base() | logger = logging.getLogger(__name__) | ||||
class ABCSQLMeta(abc.ABCMeta, DeclarativeMeta): | class ABCSQLMeta(abc.ABCMeta, DeclarativeMeta): | ||||
pass | pass | ||||
class ModelBase(SQLBase, metaclass=ABCSQLMeta): | class ModelBase(SQLBase, metaclass=ABCSQLMeta): | ||||
"""a common repository""" | """a common repository""" | ||||
▲ Show 20 Lines • Show All 47 Lines • Show Last 20 Lines |