Matteo Scandolo | e2cb8a4 | 2018-05-18 16:30:06 -0700 | [diff] [blame^] | 1 | # 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 | |
| 15 | from core.models.xosbase import * |
| 16 | |
| 17 | from models_decl import VOLTService_decl |
| 18 | from models_decl import VOLTServiceInstance_decl |
| 19 | from models_decl import OLTDevice_decl |
| 20 | from models_decl import PONPort_decl |
| 21 | from models_decl import ONUDevice_decl |
| 22 | |
| 23 | class 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 | |
| 36 | class VOLTServiceInstance(VOLTServiceInstance_decl): |
| 37 | class Meta: |
| 38 | proxy = True |
| 39 | |
| 40 | |
| 41 | class OLTDevice(OLTDevice_decl): |
| 42 | class Meta: |
| 43 | proxy = True |
| 44 | |
| 45 | |
| 46 | class PONPort(PONPort_decl): |
| 47 | class Meta: |
| 48 | proxy = True |
| 49 | |
| 50 | |
| 51 | class ONUDevice(ONUDevice_decl): |
| 52 | class Meta: |
| 53 | proxy = True |
| 54 | |