Changeset 7485 for main


Ignore:
Timestamp:
16 Jan 2012, 10:07:19 (13 years ago)
Author:
Henrik Bettermann
Message:

Store html of frontpage as an attribute of the configuration container. This increases the performance of the UniversityPage? by 400%.

Location:
main/waeup.sirp/trunk/src/waeup/sirp
Files:
2 edited

Legend:

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

    r7484 r7485  
    272272    @property
    273273    def frontpage(self):
    274         view = ConfigurationContainerDisplayFormPage(
    275             self.context['configuration'],self.request)
    276         view.setUpWidgets()
    277         return view.widgets['frontpage']()
     274        return self.context['configuration'].frontpage_html
    278275
    279276class AdministrationPage(SIRPPage):
     
    567564
    568565    form_fields = grok.AutoFields(IConfigurationContainer)
     566    form_fields['frontpage_html'].for_display = True
    569567
    570568    def update(self):
     
    579577        return super(ConfigurationContainerManageFormPage, self).update()
    580578
     579    def frontpage(self):
     580        view = ConfigurationContainerDisplayFormPage(
     581            self.context,self.request)
     582        view.setUpWidgets()
     583        return view.widgets['frontpage']()
     584
    581585    @action('Save', style='primary')
    582586    def save(self, **data):
    583587        self.applyData(self.context, **data)
     588        self.context.frontpage_html = self.frontpage()
    584589        self.flash('Settings have been saved.')
    585590        return
  • main/waeup.sirp/trunk/src/waeup/sirp/interfaces.py

    r7475 r7485  
    404404        )
    405405
     406    frontpage_html = schema.Text(
     407        title = u'Content in HTML format',
     408        required = False,
     409        )
     410
    406411    accommodation_session = schema.Choice(
    407412        title = u'Accommodation Booking Session',
Note: See TracChangeset for help on using the changeset viewer.