Ignore:
Timestamp:
26 Oct 2011, 06:27:24 (13 years ago)
Author:
Henrik Bettermann
Message:

Let's create hostels without a factory.

There is no need to override the grok.Container init method.

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

Legend:

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

    r6953 r6954  
    116116    @grok.action('Create hostel')
    117117    def addHostel(self, **data):
    118         #hostel = createObject(u'waeup.Hostel')
    119         #self.applyData(hostel, **data)
    120         hostel = Hostel(**data)
     118        hostel = Hostel()
     119        self.applyData(hostel, **data)
    121120        self.context.addHostel(hostel)
    122121        self.flash('Hostel created.')
  • main/waeup.sirp/trunk/src/waeup/sirp/hostels/hostel.py

    r6953 r6954  
    2828    grok.implements(IHostel)
    2929    grok.provides(IHostel)
    30     grok.baseclass()
    31 
    32     def __init__(self, **data):
    33         super(Hostel, self).__init__()
    34         self.hostel_id = data['hostel_id']
    35         return
    3630
    3731    def loggerInfo(self, ob_class, comment=None):
  • main/waeup.sirp/trunk/src/waeup/sirp/hostels/interfaces.py

    r6953 r6954  
    2121    hostel_id = schema.TextLine(
    2222        title = u'Hostel ID',
    23         required = False,
     23        required = True,
     24        default = u'hostel_1',
    2425        )
Note: See TracChangeset for help on using the changeset viewer.