Index: waeup/branches/hraban/src/waeup/app.py
===================================================================
--- waeup/branches/hraban/src/waeup/app.py	(revision 3566)
+++ waeup/branches/hraban/src/waeup/app.py	(revision 3571)
@@ -2,15 +2,27 @@
 #from zope.interface import Interface
 from waeup.interfaces import IUniversity
-from setup import app_setup
 from waeup.viewlets import MainArea
 from basecontainer import BaseContainer
+from waeup.hostel import hostelcontainer
+from waeup.university import facultycontainer
+from waeup.students import studentcontainer
 
 class University(grok.Application, BaseContainer):
     grok.implements(IUniversity)
+    id = 'base'
+    name = u'University'
 
     def __init__(self, **kw):
         super(University, self).__init__(**kw)
         self.__dict__.update(kw)
-        app_setup.setup(self)
+        
+        sc = studentcontainer.StudentContainer()
+        self["students"] = sc        
+    
+        hc = hostelcontainer.HostelContainer()
+        self["hostels"] = hc
+    
+        fc = facultycontainer.FacultyContainer()
+        self["faculties"] = fc
 
 #class Content(grok.Viewlet):
Index: waeup/branches/hraban/src/waeup/basecontainer.py
===================================================================
--- waeup/branches/hraban/src/waeup/basecontainer.py	(revision 3566)
+++ waeup/branches/hraban/src/waeup/basecontainer.py	(revision 3571)
@@ -1,2 +1,3 @@
+# -*- coding: utf-8 -*-
 import grok
 import os
@@ -10,7 +11,7 @@
     base methods attached to it
     """
-    grok.implements(IBaseContainer)
-    id = 'base'
-    name = u"BaseContainer"
+    #grok.implements(IBaseContainer)
+    #id = 'base'
+    #name = u"BaseContainer"
     childClass = None
     specialActions = []
@@ -31,26 +32,22 @@
     template = grok.PageTemplate(filename=os.path.join('basecontainer_templates', 'edit_form.pt'))
 
-    def update(self):
+    def __init__(self, context, request):
+        super(AddForm, self).__init__(context, request)
         self.form_fields = grok.AutoFields(self.context.childClass)
-        grok.AddForm.update(self)
 
     @grok.action('Add item')
     def add(self, **data):
         obj = self.context.childClass(**data)
-        try:
-            id = data['id'].lower()
-            self.context[id] = obj
-        except Exception, ex:
-            print ex
-            print data
-            raise ex
-        self.redirect(self.url('.'))
+        id = data['id'].lower()
+        self.context[id] = obj # schlägt fehlt bei nicht-Container-Objekten (not iterable)
+        self.redirect(self.url('@@index'))
 
 class EditForm(grok.EditForm):
     template = grok.PageTemplate(filename=os.path.join('basecontainer_templates', 'edit_form.pt'))
-   
-    def update(self):
-        self.form_fields = grok.AutoFields(self.context)
-        grok.EditForm.update(self)
+    #form_fields = grok.AutoFields(BaseContainer)
+
+    def __init__(self, context, request):
+        super(EditForm, self).__init__(context, request)
+        self.form_fields = grok.AutoFields(self.context.__class__)
         
     def handle_edit_action(self, **data):
@@ -74,5 +71,5 @@
 class EditViewlet(grok.Viewlet):
     grok.viewletmanager(vw.MainArea)
-    grok.context(IBaseContainer)
+    #grok.context(IBaseContainer)
     grok.view(vw.Edit)
     #grok.name('edit')
Index: waeup/branches/hraban/src/waeup/basecontainer_templates/edit_form.pt
===================================================================
--- waeup/branches/hraban/src/waeup/basecontainer_templates/edit_form.pt	(revision 3566)
+++ waeup/branches/hraban/src/waeup/basecontainer_templates/edit_form.pt	(revision 3571)
@@ -17,5 +17,4 @@
     </div>
     -->
-	<div tal:content="context"></div>
     <div class="form-fields">
         <tal:block repeat="widget view/widgets">
Index: waeup/branches/hraban/src/waeup/baseitem.py
===================================================================
--- waeup/branches/hraban/src/waeup/baseitem.py	(revision 3566)
+++ waeup/branches/hraban/src/waeup/baseitem.py	(revision 3571)
@@ -10,5 +10,5 @@
     Base item
     """
-    grok.implements(IBaseItem)
+    #grok.implements(IBaseItem)
     
     def __init__(self, **kwargs):
@@ -26,11 +26,11 @@
     template = grok.PageTemplate(filename=os.path.join('basecontainer_templates', 'edit_form.pt'))
 
-    def update(self):
-        self.form_fields = grok.AutoFields(self.context.childClass)
-        grok.AddForm.update(self)
+    def __init__(self, context, request):
+        super(AddForm, self).__init__(context, request)
+        self.form_fields = grok.AutoFields(self.context-__class__) #.childClass)
 
     @grok.action('Add item')
     def add(self, **data):
-        obj = self.context.childClass(**data)
+        obj = self.context.__class__(**data) #.childClass(**data)
         id = data['id'].lower()
         self.context[id] = obj
@@ -40,11 +40,11 @@
     template = grok.PageTemplate(filename=os.path.join('basecontainer_templates', 'edit_form.pt'))
    
-    def update(self):
-        self.form_fields = grok.AutoFields(self.context)
-        grok.EditForm.update(self)
-        
+    def __init__(self, context, request):
+        super(EditForm, self).__init__(context, request)
+        self.form_fields = grok.AutoFields(self.context.__class__)
+       
     def handle_edit_action(self, **data):
         grok.EditForm.handle_edit_action(self, **data)
-        self.redirect(self.url('..'))
+        self.redirect(self.url('@@index'))
 
 class AddViewlet(grok.Viewlet):
Index: waeup/branches/hraban/src/waeup/catalog.py
===================================================================
--- waeup/branches/hraban/src/waeup/catalog.py	(revision 3566)
+++ waeup/branches/hraban/src/waeup/catalog.py	(revision 3571)
@@ -1,12 +1,7 @@
-import sys
-import csv
-import random
-from datetime import datetime
-import os
 import grok, grok.index
 from hurry.query.query import Query, Text
 from hurry.query import Eq
 from waeup.app import University
-from waeup.students.interfaces import IStudent
+from waeup.students.interfaces import IStudent, IStudentContainer
 from waeup.students.student import Student
 from waeup.viewlets import MainArea, LeftSidebar
@@ -15,5 +10,5 @@
      grok.site(University)
      grok.name('students_catalog')
-     grok.context(IStudent)
+     grok.context(IStudentContainer)
 
      name = grok.index.Field(attribute='name')
@@ -21,7 +16,8 @@
 
 class StudentSearch(grok.Viewlet):
-    grok.context(IStudent)
+    grok.context(IStudentContainer)
     grok.viewletmanager(LeftSidebar)
     #grok.view(Student)
+    grok.order(3)
 
     def update(self, query=None):
Index: waeup/branches/hraban/src/waeup/catalog_templates/studentsearch.pt
===================================================================
--- waeup/branches/hraban/src/waeup/catalog_templates/studentsearch.pt	(revision 3566)
+++ waeup/branches/hraban/src/waeup/catalog_templates/studentsearch.pt	(revision 3571)
@@ -7,4 +7,5 @@
     <input type="submit" value="Search" />
   </form>
+  <!--
   <ul>
   <li tal:repeat="item view/search_result"
@@ -12,3 +13,4 @@
   </li>
   </ul>
+  -->
 </div>
Index: waeup/branches/hraban/src/waeup/hostel/hostel.py
===================================================================
--- waeup/branches/hraban/src/waeup/hostel/hostel.py	(revision 3566)
+++ waeup/branches/hraban/src/waeup/hostel/hostel.py	(revision 3571)
@@ -9,16 +9,2 @@
     grok.implements(IHostel)
     name = u'Hostel'
-    #childClass = ?
-
-
-#class Add(base.AddViewlet):
-#    grok.context(IHostel)
-#
-#class Edit(base.EditViewlet):
-#    grok.context(IHostel)
-#
-#class EditForm(base.EditForm):
-#    pass
-#
-#class AddForm(base.AddForm):
-#    pass
Index: waeup/branches/hraban/src/waeup/hostel/hostelcontainer.py
===================================================================
--- waeup/branches/hraban/src/waeup/hostel/hostelcontainer.py	(revision 3566)
+++ waeup/branches/hraban/src/waeup/hostel/hostelcontainer.py	(revision 3571)
@@ -1,9 +1,10 @@
 import grok
-from waeup.interfaces import IBaseContainer
+from waeup.hostel.interfaces import IHostelContainer
 from waeup.basecontainer import BaseContainer
 from hostel import Hostel
 
 class HostelContainer(BaseContainer):
-    grok.implements(IBaseContainer)
+    grok.implements(IHostelContainer)
+    id = 'hostels'
     name = u"Hostels"
     childClass = Hostel
Index: waeup/branches/hraban/src/waeup/hostel/interfaces.py
===================================================================
--- waeup/branches/hraban/src/waeup/hostel/interfaces.py	(revision 3566)
+++ waeup/branches/hraban/src/waeup/hostel/interfaces.py	(revision 3571)
@@ -4,7 +4,7 @@
 import re
 from zope import schema
-from waeup.interfaces import IBaseContainer
+from waeup.interfaces import IBaseItem, IBaseContainer
 
-class IHostel(IBaseContainer):
+class IHostel(IBaseItem):
     """Representation of a hostel (AKA hall).
     """
@@ -21,2 +21,4 @@
         )
 
+class IHostelContainer(IBaseContainer):
+    pass
Index: waeup/branches/hraban/src/waeup/students/interfaces.py
===================================================================
--- waeup/branches/hraban/src/waeup/students/interfaces.py	(revision 3566)
+++ waeup/branches/hraban/src/waeup/students/interfaces.py	(revision 3571)
@@ -4,9 +4,19 @@
 import re
 from zope import schema
-from waeup.interfaces import IBaseItem
+from zope.interface import Interface
+from waeup.interfaces import IBaseItem, IBaseContainer
 
-class IStudent(IBaseItem):
+class IStudentContainer(IBaseContainer):
+    pass
+
+class IStudent(Interface):
     """Representation of a student.
     """
+    id = schema.ASCIILine(
+        title = u'Student ID',
+        default = '',
+        required = True,
+        constraint=(re.compile("^([A-Z]\d{6})?$").match)
+        )
     entry_mode = schema.ASCIILine( # Choice?
         title = u'Entry Mode',
@@ -39,10 +49,4 @@
         min = 0,
         max = 600
-        )
-    id = schema.ASCIILine(
-        title = u'Student ID',
-        default = '',
-        required = False,
-        constraint=(re.compile("^([A-Z]\d{6})?$").match)
         )
     lga = schema.TextLine(
Index: waeup/branches/hraban/src/waeup/students/student.py
===================================================================
--- waeup/branches/hraban/src/waeup/students/student.py	(revision 3566)
+++ waeup/branches/hraban/src/waeup/students/student.py	(revision 3571)
@@ -21,5 +21,4 @@
     name = u'Student'
 
-    #TODO: REFACTOR TO SCHEMA
     fields = [   "entry_mode",
                  "end_level",
@@ -50,7 +49,7 @@
 
 
-class Add(base.AddViewlet):
-    grok.context(IStudent)
-
-class Edit(base.EditViewlet):
-    grok.context(IStudent)
+#class AddViewlet(base.AddViewlet):
+#    grok.context(IStudent)
+#
+#class EditEditViewlet(base.EditViewlet):
+#    grok.context(IStudent)
Index: waeup/branches/hraban/src/waeup/students/studentcontainer.py
===================================================================
--- waeup/branches/hraban/src/waeup/students/studentcontainer.py	(revision 3566)
+++ waeup/branches/hraban/src/waeup/students/studentcontainer.py	(revision 3571)
@@ -1,7 +1,8 @@
 import grok
 import os
-from waeup.interfaces import IBaseContainer
+#from waeup.interfaces import IBaseContainer
 import waeup.basecontainer as base
-from student import Student, fromCsv
+from waeup.students.student import Student, fromCsv
+from waeup.students.interfaces import IStudentContainer
 from waeup.utils import importexport as csv
 
@@ -11,4 +12,6 @@
     The node containing the student models
     """
+    grok.implements(IStudentContainer)
+    id = 'students'
     name = u"Students"
     childClass = Student
@@ -42,5 +45,15 @@
         return "yeah %s" % t[0]
 
+#class AddForm(base.AddForm):
+#    form_fields = grok.AutoFields(Student)
+#
+#class EditForm(base.EditForm):
+#    form_fields = grok.AutoFields(Student)
 
-class Edit(base.EditViewlet):
-    grok.context(IBaseContainer)
+
+#class Edit(base.EditViewlet):
+#    grok.context(IStudentContainer)
+#
+#
+#class Add(base.AddViewlet):
+#    grok.context(IStudentContainer)
Index: waeup/branches/hraban/src/waeup/university/course.py
===================================================================
--- waeup/branches/hraban/src/waeup/university/course.py	(revision 3566)
+++ waeup/branches/hraban/src/waeup/university/course.py	(revision 3571)
@@ -3,5 +3,5 @@
 from waeup.university.interfaces import ICourse
 
-class Department(base.BaseItem):
+class Course(grok.Model):
     grok.implements(ICourse)
     name = u'Course'
Index: waeup/branches/hraban/src/waeup/university/department.py
===================================================================
--- waeup/branches/hraban/src/waeup/university/department.py	(revision 3566)
+++ waeup/branches/hraban/src/waeup/university/department.py	(revision 3571)
@@ -9,6 +9,6 @@
     name = u'Department'
 
-class Add(base.AddViewlet):
-    grok.context(IDepartment)
+#class Add(base.AddViewlet):
+#    grok.context(IDepartment)
 
 
Index: waeup/branches/hraban/src/waeup/university/facultycontainer.py
===================================================================
--- waeup/branches/hraban/src/waeup/university/facultycontainer.py	(revision 3566)
+++ waeup/branches/hraban/src/waeup/university/facultycontainer.py	(revision 3571)
@@ -1,9 +1,11 @@
 import grok
 from waeup.basecontainer import BaseContainer
+from waeup.interfaces import IBaseContainer
 from waeup.university.interfaces import IFaculty
 from waeup.university.faculty import Faculty
 
 class FacultyContainer(BaseContainer):
-    #grok.implements(IBaseContainer)
+    grok.implements(IBaseContainer)
+    id = 'faculties'
     name = u'Faculties'
     childClass = Faculty
Index: waeup/branches/hraban/src/waeup/university/interfaces.py
===================================================================
--- waeup/branches/hraban/src/waeup/university/interfaces.py	(revision 3566)
+++ waeup/branches/hraban/src/waeup/university/interfaces.py	(revision 3571)
@@ -4,5 +4,5 @@
 from waeup.interfaces import IBaseContainer
 
-class IFaculty(IBaseContainer):
+class IFaculty(grok.interfaces.IContainer):
     """Representation of a university faculty.
     """
