Skip to content
Snippets Groups Projects
RelationModels.py 1.13 KiB
Newer Older
Lluis Gifre Renom's avatar
Lluis Gifre Renom committed
import logging
from common.orm.fields.ForeignKeyField import ForeignKeyField
from common.orm.fields.PrimaryKeyField import PrimaryKeyField
from common.orm.model.Model import Model
from .DeviceModel import DeviceModel
Lluis Gifre Renom's avatar
Lluis Gifre Renom committed
from .EndPointModel import EndPointModel
Lluis Gifre Renom's avatar
Lluis Gifre Renom committed
from .LinkModel import LinkModel
Lluis Gifre Renom's avatar
Lluis Gifre Renom committed
from .ServiceModel import ServiceModel
Lluis Gifre Renom's avatar
Lluis Gifre Renom committed
from .TopologyModel import TopologyModel

LOGGER = logging.getLogger(__name__)

Lluis Gifre Renom's avatar
Lluis Gifre Renom committed
class LinkEndPointModel(Model): # pylint: disable=abstract-method
Lluis Gifre Renom's avatar
Lluis Gifre Renom committed
    pk = PrimaryKeyField()
    link_fk = ForeignKeyField(LinkModel)
    endpoint_fk = ForeignKeyField(EndPointModel)

Lluis Gifre Renom's avatar
Lluis Gifre Renom committed
class ServiceEndPointModel(Model): # pylint: disable=abstract-method
Lluis Gifre Renom's avatar
Lluis Gifre Renom committed
    pk = PrimaryKeyField()
    service_fk = ForeignKeyField(ServiceModel)
    endpoint_fk = ForeignKeyField(EndPointModel)

Lluis Gifre Renom's avatar
Lluis Gifre Renom committed
class TopologyDeviceModel(Model): # pylint: disable=abstract-method
Lluis Gifre Renom's avatar
Lluis Gifre Renom committed
    pk = PrimaryKeyField()
    topology_fk = ForeignKeyField(TopologyModel)
    device_fk = ForeignKeyField(DeviceModel)

Lluis Gifre Renom's avatar
Lluis Gifre Renom committed
class TopologyLinkModel(Model): # pylint: disable=abstract-method
Lluis Gifre Renom's avatar
Lluis Gifre Renom committed
    pk = PrimaryKeyField()
Lluis Gifre Renom's avatar
Lluis Gifre Renom committed
    topology_fk = ForeignKeyField(TopologyModel)
    link_fk = ForeignKeyField(LinkModel)