Index: waeup/trunk/src/waeup/basecontainer.py
===================================================================
--- waeup/trunk/src/waeup/basecontainer.py	(revision 3526)
+++ waeup/trunk/src/waeup/basecontainer.py	(revision 3527)
@@ -6,2 +6,24 @@
     base methods and templates attached to it
     """
+    
+    name = u"BaseContainer"
+    childClass = None
+    
+class Index(grok.View):
+    """
+    Base view
+    """
+    
+class Add(grok.AddForm):
+    #form_fields = grok.AutoFields(self.context.childClass)
+#DOESN'T WORK    grok.template("../basecontainer_templates/add.pt")
+
+    def update(self):
+        self.form_fields = grok.AutoFields(self.context.childClass)
+        grok.AddForm.update(self)
+
+    @grok.action('Add Item')
+    def addItem(self, name, *args, **kw):
+        item = self.context.childClass(name=name)
+        self.context[name] = item
+        self.redirect(self.url(item))
Index: waeup/trunk/src/waeup/basecontainer_templates/add.pt
===================================================================
--- waeup/trunk/src/waeup/basecontainer_templates/add.pt	(revision 3527)
+++ waeup/trunk/src/waeup/basecontainer_templates/add.pt	(revision 3527)
@@ -0,0 +1,72 @@
+<html>
+<head>
+  <link rel="stylesheet" type="text/css"
+	tal:attributes="href static/simple.css" />
+</head>
+
+<body>
+    <h1>HUHU</h1>
+<form action="." tal:attributes="action request/URL" method="post"
+      class="edit-form" enctype="multipart/form-data">
+
+  <h1 i18n:translate=""
+    tal:condition="view/label"
+    tal:content="view/label">Label</h1>
+
+  <div class="form-status"
+    tal:define="status view/status"
+    tal:condition="status">
+
+    <div i18n:translate="" tal:content="view/status">
+      Form status summary
+    </div>
+
+    <ul class="errors" tal:condition="view/errors">
+      <li tal:repeat="error view/error_views">
+         <span tal:replace="structure error">Error Type</span>
+      </li>
+    </ul>
+  </div>
+
+  <table class="form-fields">
+    <tbody>
+      <tal:block repeat="widget view/widgets">
+        <tr>
+          <td class="label" tal:define="hint widget/hint">
+            <label tal:condition="python:hint"
+                   tal:attributes="for widget/name">
+              <span class="required" tal:condition="widget/required"
+              >*</span><span i18n:translate=""
+                             tal:content="widget/label">label</span>
+            </label>
+            <label tal:condition="python:not hint"
+                   tal:attributes="for widget/name">
+              <span class="required" tal:condition="widget/required"
+              >*</span><span i18n:translate=""
+                             tal:content="widget/label">label</span>
+            </label>
+          </td>
+          <td class="field">
+            <div class="widget" tal:content="structure widget">
+              <input type="text" />
+            </div>
+            <div class="error" tal:condition="widget/error">
+              <span tal:replace="structure widget/error">error</span>
+            </div>
+          </td>
+        </tr>
+      </tal:block>
+    </tbody>
+  </table>
+
+  <div id="actionsView">
+    <span class="actionButtons" tal:condition="view/availableActions">
+      <input tal:repeat="action view/actions"
+             tal:replace="structure action/render"
+             />
+    </span>
+  </div>
+</form>
+
+</body>
+</html>
Index: waeup/trunk/src/waeup/basecontainer_templates/index.pt
===================================================================
--- waeup/trunk/src/waeup/basecontainer_templates/index.pt	(revision 3527)
+++ waeup/trunk/src/waeup/basecontainer_templates/index.pt	(revision 3527)
@@ -0,0 +1,20 @@
+<html>
+<head>
+  <link rel="stylesheet" type="text/css"
+	tal:attributes="href static/simple.css" />
+</head>
+<body>
+    <h1 tal:content="context/name"></h1>
+    <a href="" tal:attributes="href python:view.url(context.__parent__)">Up</a>
+    <table>
+        <tr>
+            <th>Name</th>
+        </tr>
+        <tr tal:repeat="item context/values">
+            <td><a href="" tal:content="item/name"
+                           tal:attributes="href python:view.url(item)"></a></td>
+        </tr>
+    </table>
+    <a href="" tal:attributes="href python:view.url(context, 'add')">Add</a>
+</body>
+</html>
Index: waeup/trunk/src/waeup/catalog.py
===================================================================
--- waeup/trunk/src/waeup/catalog.py	(revision 3526)
+++ waeup/trunk/src/waeup/catalog.py	(revision 3527)
@@ -35,53 +35,2 @@
         return result
     
-class ImportStudents(grok.View):
-    grok.context(University)
-
-    def render(self):
-        t = [0]
-        src = os.path.join(os.path.dirname(__file__), 'tests',
-                           'results2.csv')
-        inputfile = file(src, "r")
-        num = 0
-        headers, rows = readFile(inputfile)
-        for i in rows:
-             s = Student(i)
-             self.context[str(num)] = s
-             num += 1
-        return "%s new Students added in %s" % (num, t[0])
-
-class ListView(grok.View):
-    grok.context(University)
-
-    def render(self):
-        result = []
-        for s in self.context.values():
-            result.append(getattr(s,'name', 'Error'+str(type(s))))
-        return "\n".join(result)
-
-class ExportStudents(grok.View):
-    grok.context(University)
-    
-    def render(self):
-        t = [0]
-        result = []
-        for s in self.context.values():
-             result.append(s.getCsv())
-        writeFile(result)
-        return "yeah %s" % t[0]
-        
-
-def readFile(f):
-    """read a CSV file"""
-    headers = []
-    rows = []
-    f = csv.reader(f)
-    headers = f.next()
-    for line in f:
-        rows.append(line)
-    return (headers, rows)
-
-def writeFile(data):
-    writer = csv.writer(open("export.csv", "wb"))
-    writer.writerows(data)
-
Index: waeup/trunk/src/waeup/hostel/hostel.py
===================================================================
--- waeup/trunk/src/waeup/hostel/hostel.py	(revision 3526)
+++ waeup/trunk/src/waeup/hostel/hostel.py	(revision 3527)
@@ -0,0 +1,4 @@
+import grok
+
+class Hostel(grok.Model):
+    pass
Index: waeup/trunk/src/waeup/hostel/hostelcontainer.py
===================================================================
--- waeup/trunk/src/waeup/hostel/hostelcontainer.py	(revision 3526)
+++ waeup/trunk/src/waeup/hostel/hostelcontainer.py	(revision 3527)
@@ -1,4 +1,6 @@
 from waeup.basecontainer import BaseContainer
+from hostel import Hostel
 
 class HostelContainer(BaseContainer):
     name = u"Hostels"
+    childClass = Hostel
Index: waeup/trunk/src/waeup/students/student.py
===================================================================
--- waeup/trunk/src/waeup/students/student.py	(revision 3526)
+++ waeup/trunk/src/waeup/students/student.py	(revision 3527)
@@ -8,5 +8,5 @@
     grok.implements(IStudent)
 
-    def __init__(self, a):
+    def __init__(self, name):
         """
         TODO: REFACTOR TO IMPORT METHOD
@@ -34,4 +34,7 @@
 
         """
+        self.name = name
+        
+    def fromCsv(self, a):
         self.entry_mode, self.end_level, self.name, self.jamb_reg_no, self.level, self.id, self.lga, self.entry_session, self.matric_no, self.sex, self.phone, self.session, self.course, self.mode, self.faculty, self.department, self.verdict, self.review_state,  self.perm_address, self.email = a
 
Index: waeup/trunk/src/waeup/students/studentcontainer.py
===================================================================
--- waeup/trunk/src/waeup/students/studentcontainer.py	(revision 3526)
+++ waeup/trunk/src/waeup/students/studentcontainer.py	(revision 3527)
@@ -2,4 +2,6 @@
 
 from waeup.basecontainer import BaseContainer
+from student import Student
+from waeup.utils import csv
 
 class StudentContainer(BaseContainer):
@@ -8,2 +10,27 @@
     """
     name = u"Students"
+    childClass = Student
+    
+
+class Import(grok.View):
+    def render(self):
+        t = [0]
+        src = os.path.join(os.path.dirname(__file__), 'tests',
+                           'results2.csv')
+        inputfile = file(src, "r")
+        num = 0
+        headers, rows = csv.readFile(inputfile)
+        for i in rows:
+             s = Student(i)
+             self.context[str(num)] = s
+             num += 1
+        return "%s new Students added in %s" % (num, t[0])
+
+class Export(grok.View):    
+    def render(self):
+        t = [0]
+        result = []
+        for s in self.context.values():
+             result.append(s.getCsv())
+        csv.writeFile(result)
+        return "yeah %s" % t[0]
Index: waeup/trunk/src/waeup/students/studentcontainer_templates/add.ptx
===================================================================
--- waeup/trunk/src/waeup/students/studentcontainer_templates/add.ptx	(revision 3527)
+++ waeup/trunk/src/waeup/students/studentcontainer_templates/add.ptx	(revision 3527)
@@ -0,0 +1,71 @@
+<html>
+<head>
+  <link rel="stylesheet" type="text/css"
+	tal:attributes="href string:/@@/waeup/simple.css" />
+</head>
+
+<body>
+<form action="." tal:attributes="action request/URL" method="post"
+      class="edit-form" enctype="multipart/form-data">
+
+  <h1 i18n:translate=""
+    tal:condition="view/label"
+    tal:content="view/label">Label</h1>
+
+  <div class="form-status"
+    tal:define="status view/status"
+    tal:condition="status">
+
+    <div i18n:translate="" tal:content="view/status">
+      Form status summary
+    </div>
+
+    <ul class="errors" tal:condition="view/errors">
+      <li tal:repeat="error view/error_views">
+         <span tal:replace="structure error">Error Type</span>
+      </li>
+    </ul>
+  </div>
+
+  <table class="form-fields">
+    <tbody>
+      <tal:block repeat="widget view/widgets">
+        <tr>
+          <td class="label" tal:define="hint widget/hint">
+            <label tal:condition="python:hint"
+                   tal:attributes="for widget/name">
+              <span class="required" tal:condition="widget/required"
+              >*</span><span i18n:translate=""
+                             tal:content="widget/label">label</span>
+            </label>
+            <label tal:condition="python:not hint"
+                   tal:attributes="for widget/name">
+              <span class="required" tal:condition="widget/required"
+              >*</span><span i18n:translate=""
+                             tal:content="widget/label">label</span>
+            </label>
+          </td>
+          <td class="field">
+            <div class="widget" tal:content="structure widget">
+              <input type="text" />
+            </div>
+            <div class="error" tal:condition="widget/error">
+              <span tal:replace="structure widget/error">error</span>
+            </div>
+          </td>
+        </tr>
+      </tal:block>
+    </tbody>
+  </table>
+
+  <div id="actionsView">
+    <span class="actionButtons" tal:condition="view/availableActions">
+      <input tal:repeat="action view/actions"
+             tal:replace="structure action/render"
+             />
+    </span>
+  </div>
+</form>
+
+</body>
+</html>
Index: waeup/trunk/src/waeup/university/facultycontainer.py
===================================================================
--- waeup/trunk/src/waeup/university/facultycontainer.py	(revision 3526)
+++ waeup/trunk/src/waeup/university/facultycontainer.py	(revision 3527)
@@ -2,15 +2,8 @@
 from waeup.basecontainer import BaseContainer
 from interfaces import IFaculty
+from faculty import Faculty
 
 class FacultyContainer(BaseContainer):
     
     name = u'Faculties'
-
-class AddFaculty(grok.AddForm):
-    form_fields = grok.AutoFields(IFaculty)
-
-    @grok.action('Add Faculty')
-    def addFaculty(self, name, *args, **kw):
-        new_fac = Faculty(name=name)
-        self.context[name] = new_fac
-        self.redirect(self.url(new_fac))
+    childClass = Faculty
Index: waeup/trunk/src/waeup/utils/csv.py
===================================================================
--- waeup/trunk/src/waeup/utils/csv.py	(revision 3527)
+++ waeup/trunk/src/waeup/utils/csv.py	(revision 3527)
@@ -0,0 +1,15 @@
+import csv
+
+def readFile(f):
+    """read a CSV file"""
+    headers = []
+    rows = []
+    f = csv.reader(f)
+    headers = f.next()
+    for line in f:
+        rows.append(line)
+    return (headers, rows)
+
+def writeFile(data):
+    writer = csv.writer(open("export.csv", "wb"))
+    writer.writerows(data)
