Changeset 6189


Ignore:
Timestamp:
22 May 2011, 08:32:37 (13 years ago)
Author:
Henrik Bettermann
Message:

Select application_category for applicants containers.

Implement removal of applicants.

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

Legend:

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

    r6184 r6189  
    327327    @grok.action('Remove selected')
    328328    def delApplicant(self, **data):
    329         return self.flash('Removal of applicants is not yet implemented!')
     329        form = self.request.form
     330        if form.has_key('val_id'):
     331            child_id = form['val_id']
     332        else:
     333            self.flash('No applicant selected!')
     334            self.redirect(self.url(self.context, '@@manage')+'#tab-2')
     335            return
     336        if not isinstance(child_id, list):
     337            child_id = [child_id]
     338        deleted = []
     339        for id in child_id:
     340            try:
     341                del self.context[id]
     342                deleted.append(id)
     343            except:
     344                self.flash('Could not delete %s: %s: %s' % (
     345                        id, sys.exc_info()[0], sys.exc_info()[1]))
     346        if len(deleted):
     347            self.flash('Successfully removed: %s' % ', '.join(deleted))
     348        self.redirect(self.url(self.context, u'@@manage')+'#tab-2')
     349        return
    330350
    331351    @grok.action('Add applicant', validator=NullValidator)
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/interfaces.py

    r6184 r6189  
    3535from waeup.sirp.image.image import WAeUPImageFile
    3636from waeup.sirp.interfaces import IWAeUPObject, SimpleWAeUPVocabulary
     37from waeup.sirp.university.vocabularies import application_categories
    3738
    3839
     
    207208        )
    208209
     210    application_category = schema.Choice(
     211        title = u'Category for the grouping of study courses',
     212        required = True,
     213        default = None,
     214        source = application_categories,
     215        )
     216
    209217    description = schema.Text(
    210218        title = u'Human readable description in reST format',
  • main/waeup.sirp/trunk/src/waeup/sirp/university/interfaces.py

    r6025 r6189  
    88    course_levels,
    99    semester,
    10     application_category,
     10    application_categories,
    1111    study_mode,
    1212    inst_types,
     
    221221    application_category = schema.Choice(
    222222        title = u'Application Category',
    223         vocabulary = application_category,
     223        vocabulary = application_categories,
    224224        default = u'basic',
    225225        required = True,
  • main/waeup.sirp/trunk/src/waeup/sirp/university/vocabularies.py

    r6100 r6189  
    3939    )
    4040
    41 application_category = SimpleWAeUPVocabulary(
     41application_categories = SimpleWAeUPVocabulary(
    4242    ('--',''),
    4343    ('PUME, PDE, PCE, PRENCE','basic'),
Note: See TracChangeset for help on using the changeset viewer.