75bc02612f9d — Peter Sanchez 14 years ago
More template support added
1 files changed, 22 insertions(+), 1 deletions(-)

M zerigodns/api.py
M zerigodns/api.py +22 -1
@@ 507,4 507,25 @@ class NSZoneTemplate(ZerigoDNS):
                 is_secure=self.is_secure,
                 is_debug=self.is_debug,
             ) for zdata in data.get('zone-templates', [])
-        ]
  No newline at end of file
+        ]
+
+    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
  No newline at end of file