Ignore:
Timestamp:
23 Aug 2015, 10:03:46 (9 years ago)
Author:
Henrik Bettermann
Message:

Add property to mark 'unused' records. Add FieldIndex? to applicants catalog.

Location:
main/waeup.kofa/trunk/src/waeup/kofa/applicants
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/applicant.py

    r13080 r13213  
    8383
    8484    @property
     85    def record_used(self):
     86        if (self.password,
     87            self.firstname,
     88            self.lastname,
     89            self.email) != (None, None, None, None):
     90            return True
     91        return False
     92
     93    @property
    8594    def container_code(self):
    8695        try:
     
    227236    email = index.Field(attribute='email')
    228237    state = index.Field(attribute='state')
     238    record_used = index.Field(attribute='record_used')
    229239
    230240class ApplicantFactory(grok.GlobalUtility):
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/interfaces.py

    r13211 r13213  
    327327    """
    328328    state = Attribute('Application state of an applicant')
     329    record_used = Attribute('True if password or any required field has been set')
    329330    history = Attribute('Object history, a list of messages')
    330331    display_fullname = Attribute('The fullname of an applicant')
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_applicant.py

    r10092 r13213  
    191191        return
    192192
     193    def test_record_used(self):
     194        self.applicant.password is None
     195        self.applicant.firstname is None
     196        self.applicant.lastname is None
     197        self.applicant.email is None
     198        self.applicant.record_used is False
     199        self.applicant.firstname is 'Anna'
     200        self.applicant.record_used is True
     201
    193202class ApplicantFactoryTest(FunctionalTestCase):
    194203
Note: See TracChangeset for help on using the changeset viewer.