blob: eeb5e74c0abffddee0243462f1f98906d0ef1b8f [file] [log] [blame]
Matteo Scandoloe2cb8a42018-05-18 16:30:06 -07001# Copyright 2017-present Open Networking Foundation
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15from core.models.xosbase import *
16
17from models_decl import VOLTService_decl
18from models_decl import VOLTServiceInstance_decl
19from models_decl import OLTDevice_decl
20from models_decl import PONPort_decl
21from models_decl import ONUDevice_decl
22
23class VOLTService(VOLTService_decl):
24 class Meta:
25 proxy = True
26
27 @staticmethod
28 def has_access_device(serial_number):
29 try:
30 ONUDevice.objects.get(serial_number=serial_number)
31 return True
32 except IndexError, e:
33 return False
34
35
36class VOLTServiceInstance(VOLTServiceInstance_decl):
37 class Meta:
38 proxy = True
39
40
41class OLTDevice(OLTDevice_decl):
42 class Meta:
43 proxy = True
44
45
46class PONPort(PONPort_decl):
47 class Meta:
48 proxy = True
49
50
51class ONUDevice(ONUDevice_decl):
52 class Meta:
53 proxy = True
54