Changeset 8010 for main/waeup.kofa/trunk
- Timestamp:
- 30 Mar 2012, 10:32:27 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/applicants/interfaces.py
r8008 r8010 135 135 # apppins_dict[value][1],self.apppins_dict[value][0]) 136 136 137 class ApplicantContainerProviderSource(BasicSourceFactory):138 """A source offering all available applicants container types.139 140 The values returned by this source are names of utilities that can141 create :class:`ApplicantContainer` instances. So, if you get a142 name like ``'myactype'`` from this source, then you can do:143 144 >>> from zope.component import getUtility145 >>> p = getUtility(IApplicantsContainerProvider, name=myactype)146 >>> my_applicants_container = p.factory()147 148 Or you can access class-attributes like149 150 >>> my_applicants_container.container_title151 'Pretty'152 153 """154 def getValues(self):155 """Returns a list of ``(<name>, <provider>)`` tuples.156 157 Here ``<name>`` is the name under which an158 :class:``ApplicantContainerProvider`` was registered as a159 utility and ``<provider>`` is the utility itself.160 """161 return getUtilitiesFor(IApplicantsContainerProvider)162 163 def getToken(self, value):164 """Return the name of the ``(<name>, <provider>)`` tuple.165 """166 return value[0]167 168 def getTitle(self, value):169 """Get a 'title - description' string for a container type.170 """171 factory = value[1].factory172 return "%s - %s" % (173 factory.container_title, factory.container_description)174 137 175 138 class IApplicantsUtils(Interface):
Note: See TracChangeset for help on using the changeset viewer.