2019-12-02 03:32:03 +00:00
|
|
|
class RecordEntry(object):
|
|
|
|
"""
|
|
|
|
This is not a model, it's just an object
|
|
|
|
which will store records entries from PowerDNS API
|
|
|
|
"""
|
|
|
|
def __init__(self,
|
|
|
|
name=None,
|
|
|
|
type=None,
|
|
|
|
status=None,
|
|
|
|
ttl=None,
|
|
|
|
data=None,
|
2019-12-09 10:50:48 +00:00
|
|
|
comment=None,
|
2019-12-02 03:32:03 +00:00
|
|
|
is_allowed_edit=False):
|
|
|
|
self.name = name
|
|
|
|
self.type = type
|
|
|
|
self.status = status
|
|
|
|
self.ttl = ttl
|
|
|
|
self.data = data
|
2019-12-09 10:50:48 +00:00
|
|
|
self.comment = comment
|
2019-12-02 03:32:03 +00:00
|
|
|
self._is_allowed_edit = is_allowed_edit
|
|
|
|
self._is_allowed_delete = is_allowed_edit and self.type != 'SOA'
|
|
|
|
|
|
|
|
def is_allowed_edit(self):
|
|
|
|
return self._is_allowed_edit
|
|
|
|
|
|
|
|
def is_allowed_delete(self):
|
|
|
|
return self._is_allowed_delete
|