Ignore:
Timestamp:
7 Feb 2009, 11:00:20 (16 years ago)
Author:
uli
Message:

Render faculties in viewlets.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • waeup/branches/ulif-rewrite/src/waeup/university/faculty.py

    r3913 r3926  
    11import grok
    2 from waeup.basecontainer import BaseContainer
    32from waeup.interfaces import IFaculty
     3from waeup.viewlets import MainArea, LeftSidebar, Index, FormWrapMixin
    44
    5 class Faculty(BaseContainer):
     5class Faculty(grok.Container):
    66    grok.implements(IFaculty)
    77
     
    1010        self.name = name
    1111
    12 class Index(grok.DisplayForm):
     12class DisplayForm(grok.DisplayForm):
     13    grok.context(IFaculty)
    1314    form_fields = grok.AutoFields(IFaculty)
    1415
     16class Content(FormWrapMixin, grok.Viewlet):
     17    """A viewlet that wraps the `AddFacultyForm`.
     18    """
     19    grok.viewletmanager(MainArea)
     20    grok.context(IFaculty)
     21    grok.view(Index)
     22    grok.require('waeup.manageUniversity')
     23
     24    formview_name = 'displayform' # The name of the formview we want
     25                                  # to be rendered in this viewlet.
     26
    1527grok.global_utility(Faculty, provides=IFaculty)
Note: See TracChangeset for help on using the changeset viewer.