Ignore:
Timestamp:
25 Jan 2011, 01:07:41 (14 years ago)
Author:
uli
Message:

Commit last changes, although they are shitty. Don't look at these
changes as they will go away soon anyway.

File:
1 edited

Legend:

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

    r5483 r5668  
    2828    IResultEntry, IApplicant, IApplicantContainer, IApplicantPDEEditData
    2929    )
     30from waeup.sirp.widgets.passportwidget import PassportImage
    3031
    3132class ResultEntry(grok.Context):
     
    3738   
    3839class Applicant(grok.Context):
     40    # class Applicant(grok.Model):
    3941    grok.implements(IApplicant, IApplicantPDEEditData)
    4042    grok.provides(IApplicant)
     
    105107        self.import_from = None
    106108
     109class ApplicantTraverser(grok.Traverser):
     110    grok.context(IApplicant)
     111    def traverse(self, name):
     112        #passport_filename = self.context.passport.filename
     113        passport_filename = getattr(self.context.passport, 'filename', None)
     114        print "FILENAME: ", passport_filename
     115        if name == passport_filename:
     116            print "USE FILE", self.context.passport
     117            return self.context.passport
     118        if name == 'passport.jpg':
     119            if self.context.passport is not None:
     120                print "PP: ", self.context.passport
     121                return self.context.passport
     122            return PassportImage(None)
     123
    107124class ApplicantFactory(grok.GlobalUtility):
    108125    """A factory for faculty containers.
     
    119136        return implementedBy(Applicant)
    120137
    121         
     138     
    122139class ApplicantContainer(grok.Container):
    123140    grok.implements(IApplicantContainer)
Note: See TracChangeset for help on using the changeset viewer.