Changeset 4500 for waeup/branches


Ignore:
Timestamp:
31 Jul 2009, 10:11:45 (15 years ago)
Author:
uli
Message:

Add simple display form viewlet for certificates.

File:
1 edited

Legend:

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

    r4486 r4500  
    99from waeup.interfaces import (ICertificate, ICertificateContainer,
    1010                              ICertificateCourse, ICourse, IDepartment)
     11from waeup.viewlets import FormWrapMixin, Index, MainArea
    1112
    1213class Certificate(grok.Container):
     
    103104        return implementedBy(CertificateCourse)
    104105
     106class DisplayForm(grok.DisplayForm):
     107    grok.context(ICertificate)
     108    form_fields = grok.AutoFields(ICertificate)
     109 
     110class Content(FormWrapMixin, grok.Viewlet):
     111    """A viewlet that wraps the `DisplayForm`.
     112    """
     113    grok.viewletmanager(MainArea)
     114    grok.context(ICertificate)
     115    grok.view(Index)
     116    grok.order(2)
     117    formview_name = 'displayform' # The name of the formview we want
     118                                  # to be rendered in this viewlet.
     119
     120   
    105121@grok.subscribe(ICourse, grok.IObjectRemovedEvent)
    106122def removedCourseHandler(course, event):
Note: See TracChangeset for help on using the changeset viewer.