Changeset 12859 for main/waeup.kofa/trunk/src/waeup
- Timestamp:
- 16 Apr 2015, 18:49:08 (10 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/accesscodes/export.py
r12180 r12859 27 27 28 28 class AccessCodeBatchExporter(grok.GlobalUtility, ExporterBase): 29 """Exporter for accesscodebatches. 29 """The Access Code Batch Exporter exports container data. It does not 30 export access codes inside the container. 30 31 """ 31 32 grok.implements(ICSVExporter) 32 33 grok.name('accesscodebatches') 33 34 34 #: Fieldnames considered by this exporter35 35 fields = tuple(sorted(iface_names(IAccessCodeBatch))) + ('batch_id',) 36 37 #: The title under which this exporter will be displayed38 36 title = _(u'Access Code Batches') 39 37 … … 48 46 def export_all(self, site, filepath=None): 49 47 """Export accesscode batches into filepath as CSV data. 50 51 48 If `filepath` is ``None``, a raw string with CSV data is returned. 52 49 """ … … 57 54 return self.close_outfile(filepath, outfile) 58 55 56 59 57 class AccessCodeExporter(grok.GlobalUtility, ExporterBase): 60 """Exporter for courses. 58 """The Access Code Exporter exports all access codes stored in the 59 access code batch containers. The exporter iterates over all access code 60 batches and over all access codes inside each batch container. 61 61 """ 62 62 grok.implements(ICSVExporter) 63 63 grok.name('accesscodes') 64 64 65 #: Fieldnames considered by this exporter66 65 fields = tuple(sorted(iface_names(IAccessCode))) 67 68 #: The title under which this exporter will be displayed69 66 title = _(u'Access Codes') 70 67 71 68 def mangle_value(self, value, name, context=None): 69 """The mangler adds a hash symbol at the end of ``random_num`` 70 to avoid annoying automatic number transformation by Excel or Calc. 71 """ 72 72 if name == 'random_num' and value is not None: 73 73 # Append hash '#' to numbers to circumvent … … 80 80 def export_all(self, site, filepath=None): 81 81 """Export accesscodes into filepath as CSV data. 82 83 82 If `filepath` is ``None``, a raw string with CSV data is returned. 84 83 """ -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/export.py
r12180 r12859 29 29 30 30 class ApplicantsContainerExporter(grok.GlobalUtility, ExporterBase): 31 """Exporter for ApplicantsContainers. 31 """The Applicants Container Exporter exports container data. It does not 32 export applicants (application records) inside the container. 32 33 """ 33 34 grok.implements(ICSVExporter) 34 35 grok.name('applicantscontainers') 35 36 36 #: Fieldnames considered by this exporter37 37 fields = tuple(sorted(iface_names(IApplicantsContainer))) 38 #: The title under which this exporter will be displayed39 38 title = _(u'Applicants Containers') 40 39 … … 63 62 return self.export(containers.values(), filepath) 64 63 64 65 65 class ApplicantExporter(grok.GlobalUtility, ExporterBase): 66 """Exporter for Applicants. 66 """The Applicant Exporter exports all application records (= applicants) 67 stored in the database. In contrast to the exporters in the academics 68 section this exporter does not iterate over the items of containers 69 but searches the Applicants Catalog instead. 67 70 """ 68 71 grok.implements(ICSVExporter) 69 72 grok.name('applicants') 70 73 71 #: Fieldnames considered by this exporter72 74 fields = tuple(sorted(IApplicantBaseData.names())) + ('container_code',) 73 74 #: The title under which this exporter will be displayed75 75 title = _(u'Applicants') 76 76 77 77 def mangle_value(self, value, name, context=None): 78 """The mangler determines the the codes of the atributes `course1`, 79 `course2` and `course_admitted`. It furthermore prepares the 80 history messages and adds a hash symbol at the end of the phone number 81 to avoid annoying automatic number transformation by Excel or Calc. 82 """ 78 83 if name in ( 79 84 'course1', 'course2', 'course_admitted') and value is not None: -
main/waeup.kofa/trunk/src/waeup/kofa/hostels/export.py
r9307 r12859 26 26 27 27 class HostelExporter(grok.GlobalUtility, ExporterBase): 28 """Exporter for hostels. 28 """The Hostel Exporter exports container data. It does not 29 export beds inside the container. 29 30 """ 30 31 grok.implements(ICSVExporter) 31 32 grok.name('hostels') 32 33 33 #: Fieldnames considered by this exporter34 34 fields = tuple(sorted(iface_names(IHostel))) 35 36 #: The title under which this exporter will be displayed37 35 title = _(u'Hostels') 38 36 39 37 def export_all(self, site, filepath=None): 40 38 """Export hostels into filepath as CSV data. 41 42 39 If `filepath` is ``None``, a raw string with CSV data is returned. 43 40 """ … … 48 45 return self.close_outfile(filepath, outfile) 49 46 47 50 48 class BedExporter(grok.GlobalUtility, ExporterBase): 51 """Exporter for courses. 49 """The Bed Exporter exports all beds stored in the 50 hostel containers. The exporter iterates over all hostels 51 and over all beds inside each hostel container. 52 52 """ 53 53 grok.implements(ICSVExporter) 54 54 grok.name('beds') 55 55 56 #: Fieldnames considered by this exporter57 56 fields = tuple(sorted(iface_names(IBed))) + ( 58 57 'hall', 'block', 'room', 'bed', 'special_handling', 'sex', 'bt') 59 60 #: The title under which this exporter will be displayed61 58 title = _(u'Beds') 62 59 63 60 def export_all(self, site, filepath=None): 64 61 """Export beds into filepath as CSV data. 65 66 62 If `filepath` is ``None``, a raw string with CSV data is returned. 67 63 """ -
main/waeup.kofa/trunk/src/waeup/kofa/userscontainer.py
r12219 r12859 62 62 63 63 class UserExporter(grok.GlobalUtility, ExporterBase): 64 """Exporter for user accounts. 64 """The User Exporter exports all user accounts. It iterates over all 65 objects of the ``users`` container. 65 66 """ 66 67 grok.implements(ICSVExporter) 67 68 grok.name('users') 68 69 69 #: Fieldnames considered by this exporter70 70 fields = ('name', 'title', 'public_name', 'description', 71 71 'email', 'phone', 'roles', 'local_roles', 'password') 72 73 #: The title under which this exporter will be displayed74 72 title = _(u'Users') 75 73 76 74 def mangle_value(self, value, name, context=None): 77 """Treat location values special. 75 """The mangler determines the local roles each user has and computes 76 a Python expression like: 77 78 ``{u'waeup.local.ClearanceOfficer': [u'faculties/ABC/', u'faculties/DEF/']}`` 78 79 """ 79 80 80 if name == 'local_roles' and context is not None: 81 81 local_roles = context.getLocalRoles()
Note: See TracChangeset for help on using the changeset viewer.