Changeset 12397


Ignore:
Timestamp:
5 Jan 2015, 07:07:05 (10 years ago)
Author:
Henrik Bettermann
Message:

Set interface for grok.AutoFields? in Product class to avoid customizing all pages. This is what we have to do for all classes subject to customization.

Location:
main/waeup.ikoba/trunk/src/waeup/ikoba/products
Files:
2 edited

Legend:

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

    r12362 r12397  
    151151    grok.template('productpage')
    152152    #grok.template('basepage')
    153     form_fields = grok.AutoFields(IProduct).omit('terms_and_conditions')
    154     pnav = 1
     153    pnav = 1
     154
     155    @property
     156    def form_fields(self):
     157        return grok.AutoFields(
     158            self.context.form_fields_interface).omit('terms_and_conditions')
    155159
    156160    @property
     
    175179    grok.name('manage')
    176180    grok.require('waeup.manageProducts')
    177     form_fields = grok.AutoFields(IProduct).omit('product_id')
    178181    grok.template('productmanagepage')
    179182    pnav = 1
     
    182185    tabtwoactions1 = [_('Remove selected local roles')]
    183186    tabtwoactions2 = [_('Add local role')]
     187
     188
     189    @property
     190    def form_fields(self):
     191        return grok.AutoFields(
     192            self.context.form_fields_interface).omit('product_id')
    184193
    185194    def label(self):
  • main/waeup.ikoba/trunk/src/waeup/ikoba/products/product.py

    r12361 r12397  
    4141    grok.provides(IProduct)
    4242    #grok.baseclass()
     43
     44    form_fields_interface = IProduct
    4345
    4446    local_roles = [
Note: See TracChangeset for help on using the changeset viewer.