Ignore:
Timestamp:
5 Dec 2011, 07:19:26 (13 years ago)
Author:
Henrik Bettermann
Message:

Define WAeUPForm based on from megrok.layout.Form and use this view in pages.py.

Location:
main/waeup.sirp/trunk/src/waeup/sirp/browser
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/browser/__init__.py

    r7229 r7274  
    22
    33from waeup.sirp.browser.layout import (
    4     WAeUPPage, WAeUPLayout, WAeUPDisplayFormPage, WAeUPEditFormPage,
     4    WAeUPPage, WAeUPForm, WAeUPLayout, WAeUPDisplayFormPage, WAeUPEditFormPage,
    55    WAeUPAddFormPage, NullValidator)
    66from waeup.sirp.browser.pages import ContactAdminForm
  • main/waeup.sirp/trunk/src/waeup/sirp/browser/layout.py

    r7254 r7274  
    2323import grokcore.view
    2424from hurry.resource import mode
    25 from megrok.layout import Page, Layout, EditForm, DisplayForm, AddForm
     25from megrok.layout import Page, Layout, Form, EditForm, DisplayForm, AddForm
    2626from z3c.flashmessage.interfaces import IMessageSource, IMessageReceiver
    2727from zope.component import getUtility, queryUtility, ComponentLookupError
     
    106106    grok.baseclass()
    107107
     108class WAeUPForm(Form, UtilityView):
     109    """A megrok.layout.Form with additional methods.
     110    """
     111    grok.baseclass()
     112
     113    def setUpWidgets(self,ignore_request=False):
     114        super(WAeUPForm,self).setUpWidgets(ignore_request)
     115        if self.widgets.get('subject'):
     116            self.widgets['subject'].displayWidth = 45
     117        if self.widgets.get('body'):
     118            self.widgets['body'].height = 10
     119        if self.widgets.get('body'):
     120            self.widgets['body'].width = 35
     121
    108122class WAeUPPage(Page):
    109123    """A megrok.layout page with additional methods.
  • main/waeup.sirp/trunk/src/waeup/sirp/browser/pages.py

    r7240 r7274  
    3737from zope.event import notify
    3838from zope.session.interfaces import ISession
    39 from megrok.layout import Form
    4039from waeup.sirp.browser import (
    41     WAeUPPage, WAeUPEditFormPage, WAeUPAddFormPage,
     40    WAeUPPage, WAeUPForm, WAeUPEditFormPage, WAeUPAddFormPage,
    4241    WAeUPDisplayFormPage, NullValidator)
    4342from waeup.sirp.browser.interfaces import (
     
    193192#
    194193
    195 class ContactAdminForm(Form):
     194class ContactAdminForm(WAeUPForm):
    196195    grok.name('contactadmin')
    197196    #grok.context(IUniversity)
Note: See TracChangeset for help on using the changeset viewer.