Ignore:
Timestamp:
2 Dec 2014, 14:38:31 (10 years ago)
Author:
Henrik Bettermann
Message:

Implement HREFDisplayWidget which renders a persistent object title inside an anchor element
referring to the object.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.ikoba/trunk/src/waeup/ikoba/customers/browser.py

    r12112 r12119  
    4747from waeup.ikoba.browser.interfaces import ICaptchaManager
    4848from waeup.ikoba.mandates.mandate import PasswordMandate
     49from waeup.ikoba.widgets.hrefwidget import HREFDisplayWidget
    4950from waeup.ikoba.utils.helpers import get_current_principal, to_timezone, now
    5051from waeup.ikoba.customers.interfaces import (
     
    6869    if changed_fields:
    6970        changed_fields = reduce(lambda x,y: x+y, changed_fields.values())
    70     if 'product' in changed_fields and data['product'] is not None:
    71         view.context.last_product_id = data['product'].product_id
     71    if 'product_object' in changed_fields and data['product_object'] is not None:
     72        view.context.last_product_id = data['product_object'].product_id
    7273        notify(grok.ObjectModifiedEvent(view.context))
    7374    fields_string = ' + '.join(changed_fields)
     
    11551156    @property
    11561157    def form_fields(self):
    1157         return grok.AutoFields(self.context.form_fields_interface).omit(
     1158        form_fields = grok.AutoFields(self.context.form_fields_interface).omit(
    11581159            'last_transition_date')
     1160        for field in form_fields:
     1161            if field.__name__.endswith('_object'):
     1162                form_fields[field.__name__].custom_widget = HREFDisplayWidget
     1163        return form_fields
    11591164
    11601165    @property
Note: See TracChangeset for help on using the changeset viewer.