Commits

Peter Sanchez  committed 75bc026

More template support added

  • Participants
  • Parent commits e9c13da

Comments (0)

Files changed (1)

File zerigodns/api.py

                 is_secure=self.is_secure,
                 is_debug=self.is_debug,
             ) for zdata in data.get('zone-templates', [])
-        ]
+        ]
+
+    def reload(self):
+        if not hasattr(self, 'id'):
+            raise ZerigoError(
+                'Cannot retrieve zone template without a valid id'
+            )
+        xml = self.send_request(method='GET', id=self.id)
+        data = self.parse(xml)
+        self.load(data['zone-template'])
+        return self
+
+    def find(self, id):
+        zone = NSZoneTemplate(
+            self.user,
+            self.key,
+            data={'id': id,},
+            is_secure=self.is_secure,
+            is_debug=self.is_debug
+        )
+        zone.reload()
+        return zone