- Timestamp:
- 24 Aug 2015, 06:34:28 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/applicants/container.py
r13077 r13217 27 27 from zope.component.factory import Factory 28 28 from zope.component.interfaces import IFactory 29 from zope.catalog.interfaces import ICatalog 29 30 from waeup.kofa.interfaces import MessageFactory as _ 30 31 from waeup.kofa.applicants.interfaces import ( … … 67 68 applicant.applicant_id = applicant_id 68 69 self[applicant.application_number] = applicant 70 return 71 72 @property 73 def counts(self): 74 total = len(self) 75 code = self.code + '+' 76 cat = getUtility(ICatalog, name='applicants_catalog') 77 results = list( 78 cat.searchResults(container_code=(code, code))) 79 return len(self), len(results) 80 81 @property 82 def first_unused(self): 83 code = self.code + '-' 84 cat = getUtility(ICatalog, name='applicants_catalog') 85 results = list( 86 cat.searchResults(container_code=(code, code))) 87 if results: 88 return results[0] 69 89 return 70 90
Note: See TracChangeset for help on using the changeset viewer.