CORD-2752 Convert vnaas attic to _decl

Change-Id: Iad8a2386d7b658c4ca7adfcb9ffa71c62c34e869
diff --git a/xos/synchronizer/models/attic/header.py b/xos/synchronizer/models/attic/header.py
deleted file mode 100755
index b7100ed..0000000
--- a/xos/synchronizer/models/attic/header.py
+++ /dev/null
@@ -1,22 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-from django.db import models
-from django.db.models import *
-from core.models import Service
-from core.models import XOSBase
-from core.models import Site
-
-
diff --git a/xos/synchronizer/models/attic/usernetworkinterface_model.py b/xos/synchronizer/models/attic/usernetworkinterface_model.py
deleted file mode 100755
index 121611e..0000000
--- a/xos/synchronizer/models/attic/usernetworkinterface_model.py
+++ /dev/null
@@ -1,35 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-def __xos_save_base(self, *args, **kwargs):
-
-    if self.latlng:
-        try:
-            latlng_value = getattr(self, 'latlng').strip()
-            if (latlng_value.startswith('[') and latlng_value.endswith(']') and latlng_value.index(',') > 0):
-                lat = latlng_value[1: latlng_value.index(',')].strip()
-                lng = latlng_value[latlng_value.index(',') + 1: len(latlng_value) - 1].strip()
-
-                # If lat and lng are not floats, the code below should result in an error.
-                lat_validation = float(lat)
-                lng_validation = float(lng)
-            else:
-                raise ValueError("The lat/lng value is not formatted correctly.")
-        except:
-            raise ValueError("The lat/lng value is not formatted correctly.")
-
-    return False # let xosbase know to save the model
-
diff --git a/xos/synchronizer/models/models.py b/xos/synchronizer/models/models.py
new file mode 100644
index 0000000..c8e46b1
--- /dev/null
+++ b/xos/synchronizer/models/models.py
@@ -0,0 +1,55 @@
+
+# Copyright 2017-present Open Networking Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+from xos.exceptions import *
+from models_decl import *
+
+class EnterpriseLocation(EnterpriseLocation_decl):
+    class Meta:
+        proxy = True
+
+class OnosModel(OnosModel_decl):
+    class Meta:
+        proxy = True
+
+class UserNetworkInterface(UserNetworkInterface_decl):
+    class Meta:
+        proxy = True
+
+    def save(self, *args, **kwargs):
+        if self.latlng:
+            try:
+                latlng_value = getattr(self, 'latlng').strip()
+                if (latlng_value.startswith('[') and latlng_value.endswith(']') and latlng_value.index(',') > 0):
+                    lat = latlng_value[1: latlng_value.index(',')].strip()
+                    lng = latlng_value[latlng_value.index(',') + 1: len(latlng_value) - 1].strip()
+
+                    # If lat and lng are not floats, the code below should result in an error.
+                    lat_validation = float(lat)
+                    lng_validation = float(lng)
+                else:
+                    raise ValueError("The lat/lng value is not formatted correctly.")
+            except:
+                raise ValueError("The lat/lng value is not formatted correctly.")
+
+        super(UserNetworkInterface, self).save(*args, **kwargs)
+
+class BandwidthProfile(BandwidthProfile_decl):
+    class Meta:
+        proxy = True
+
+class ELine(ELine_decl):
+    class Meta:
+        proxy = True
\ No newline at end of file
diff --git a/xos/synchronizer/models/vnaas.xproto b/xos/synchronizer/models/vnaas.xproto
old mode 100755
new mode 100644
index 00d73b3..1da327e
--- a/xos/synchronizer/models/vnaas.xproto
+++ b/xos/synchronizer/models/vnaas.xproto
@@ -1,5 +1,6 @@
 option name = "vnaas";
 option app_label = "vnaas";
+option legacy = "True";
 
 message EnterpriseLocation (XOSBase){
      option verbose_name = "Enterprise Location";