Ignore:
Timestamp:
14 Nov 2014, 22:32:42 (10 years ago)
Author:
Henrik Bettermann
Message:

Add components for customer management. Some tests are still missing.

Location:
main/waeup.kofa/branches/henrik-regista/src/waeup/ikoba/browser
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/branches/henrik-regista/src/waeup/ikoba/browser/interfaces.py

    r11954 r11958  
    184184        constraint=validate_email,
    185185        )
     186
     187class ICustomerNavigationBase(IIkobaObject):
     188    """Objects that provide customer navigation should
     189       implement this interface.
     190    """
     191    customer = Attribute('''Some customer object that has a '''
     192                        ''' `display_fullname` attribute.''')
  • main/waeup.kofa/branches/henrik-regista/src/waeup/ikoba/browser/layout.py

    r11954 r11958  
    3636from waeup.ikoba.utils.helpers import to_timezone
    3737from waeup.ikoba.authentication import get_principal_role_manager
     38from waeup.ikoba.browser.interfaces import ICustomerNavigationBase
    3839
    3940grok.templatedir('templates')
     
    258259        return self.request.principal.user_type == 'customer'
    259260
     261    def getCustomerName(self):
     262        """Return the customer name.
     263        """
     264        if ICustomerNavigationBase.providedBy(self.context):
     265            return self.context.customer.display_fullname
     266
    260267    def formatDatetime(self,datetimeobj):
    261268        if isinstance(datetimeobj, datetime):
Note: See TracChangeset for help on using the changeset viewer.