]> git.llucax.com Git - software/pymin.git/blobdiff - services/dns/ns.py
Add GPL v3 license to the project
[software/pymin.git] / services / dns / ns.py
index f5b63ac05e34f8baf22f9f399adac348547ac4ad..510ec31c11f81e619ab3a2b281e4693809bda91d 100644 (file)
@@ -1,18 +1,15 @@
 # vim: set encoding=utf-8 et sw=4 sts=4 :
 
-# TODO documentation, validation
+# TODO documentation
 
-from pymin.seqtools import Sequence
+from pymin.validation import Item, Field, FullyQualifiedHostName
 from pymin.service.util import DictComposedSubHandler
 
 __all__ = ('NameServerHandler',)
 
 
-class NameServer(Sequence):
-    def __init__(self, name):
-        self.name = name
-    def as_tuple(self):
-        return (self.name,)
+class NameServer(Item):
+    name = Field(FullyQualifiedHostName(not_empty=True))
 
 class NameServerHandler(DictComposedSubHandler):
     handler_help = u"Manage DNS name servers (NS)"