summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaúl Benencia <rbenencia@linti.unlp.edu.ar>2012-08-02 13:18:26 -0300
committerRaúl Benencia <rbenencia@linti.unlp.edu.ar>2012-08-02 13:18:26 -0300
commit588a241bebfc477ef117c3f87e5c405edbe5bec5 (patch)
treeb8472c8c1f06a644bb5db9dc15da27b407b8a18b
parentab15c97378d41e6084eac42843e44733d1444bd7 (diff)
Updated model classes
-rw-r--r--model.py (renamed from data.py)25
1 files changed, 23 insertions, 2 deletions
diff --git a/data.py b/model.py
index 4b48e19..5894e05 100644
--- a/data.py
+++ b/model.py
@@ -5,12 +5,33 @@ class Network():
def __init__(self, name):
self.name = name
- self.domain = None
+ self.domain = []
self.ip_blocks = []
self.data = {}
+class Domain():
+ """A simple domain definition"""
+
+ def __init__(self, name, domain):
+ self.name = name
+ self.domain = domain
+ self.admins = []
+
+ def add_admin(self, admin):
+ """Add an administrator for this network"""
+
+ self.admins.append(admin)
+
+class Person():
+ """A simple person definition"""
+
+ def __init__(self, name, surname, email):
+ self.name = name
+ self.surname = surname
+ self.email = email
+
class Data():
- """Abstract class for storing network information"""
+ """Abstract class for storing anf getting information"""
def __init__(self, config):
self.networks = []
nihil fit ex nihilo