Address a warning from SQLAlchemy for declarative_base
as of 1.4 that has moved
This commit is contained in:
parent
fea643145a
commit
304cec9dd5
|
@ -2,7 +2,7 @@
|
||||||
################################################################################
|
################################################################################
|
||||||
#
|
#
|
||||||
# Rattail -- Retail Software Framework
|
# Rattail -- Retail Software Framework
|
||||||
# Copyright © 2010-2020 Lance Edgar
|
# Copyright © 2010-2023 Lance Edgar
|
||||||
#
|
#
|
||||||
# This file is part of Rattail.
|
# This file is part of Rattail.
|
||||||
#
|
#
|
||||||
|
@ -24,13 +24,13 @@
|
||||||
Data models for tempmon
|
Data models for tempmon
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from __future__ import unicode_literals, absolute_import
|
|
||||||
|
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
import six
|
|
||||||
import sqlalchemy as sa
|
import sqlalchemy as sa
|
||||||
from sqlalchemy import orm
|
from sqlalchemy import orm
|
||||||
|
try:
|
||||||
|
from sqlalchemy.orm import declarative_base
|
||||||
|
except ImportError:
|
||||||
from sqlalchemy.ext.declarative import declarative_base
|
from sqlalchemy.ext.declarative import declarative_base
|
||||||
|
|
||||||
from rattail import enum
|
from rattail import enum
|
||||||
|
@ -41,7 +41,6 @@ from rattail.db.model.core import ModelBase
|
||||||
Base = declarative_base(cls=ModelBase)
|
Base = declarative_base(cls=ModelBase)
|
||||||
|
|
||||||
|
|
||||||
@six.python_2_unicode_compatible
|
|
||||||
class Appliance(Base):
|
class Appliance(Base):
|
||||||
"""
|
"""
|
||||||
Represents an appliance which is monitored by tempmon.
|
Represents an appliance which is monitored by tempmon.
|
||||||
|
@ -81,7 +80,6 @@ class Appliance(Base):
|
||||||
return self.name
|
return self.name
|
||||||
|
|
||||||
|
|
||||||
@six.python_2_unicode_compatible
|
|
||||||
class Client(Base):
|
class Client(Base):
|
||||||
"""
|
"""
|
||||||
Represents a tempmon client.
|
Represents a tempmon client.
|
||||||
|
@ -139,7 +137,6 @@ class Client(Base):
|
||||||
return [probe for probe in self.probes if probe.enabled]
|
return [probe for probe in self.probes if probe.enabled]
|
||||||
|
|
||||||
|
|
||||||
@six.python_2_unicode_compatible
|
|
||||||
class Probe(Base):
|
class Probe(Base):
|
||||||
"""
|
"""
|
||||||
Represents a probe connected to a tempmon client.
|
Represents a probe connected to a tempmon client.
|
||||||
|
@ -399,7 +396,6 @@ class Probe(Base):
|
||||||
return self.error_timeout
|
return self.error_timeout
|
||||||
|
|
||||||
|
|
||||||
@six.python_2_unicode_compatible
|
|
||||||
class Reading(Base):
|
class Reading(Base):
|
||||||
"""
|
"""
|
||||||
Represents a single temperature reading from a tempmon probe.
|
Represents a single temperature reading from a tempmon probe.
|
||||||
|
|
Loading…
Reference in a new issue