Ignore:
Timestamp:
13 Mar 2013, 06:16:28 (12 years ago)
Author:
Henrik Bettermann
Message:

Ease skipping file upload viewlets in custom packages.

Location:
main/waeup.kofa/trunk/src/waeup/kofa/students
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py

    r10020 r10021  
    669669        }
    670670
     671    SKIP_UPLOAD_VIEWLETS = ()
     672
    671673    #: A prefix used when generating new student ids. Each student id will
    672674    #: start with this string. The default is 'K' for ``Kofa``.
  • main/waeup.kofa/trunk/src/waeup/kofa/students/viewlets.py

    r9938 r10021  
    4949    IStudentsContainer, IStudent, IStudentStudyCourse, IStudentAccommodation,
    5050    IStudentStudyLevel, ICourseTicket, IStudentOnlinePayment, IBedTicket,
    51     IStudentPaymentsContainer,
     51    IStudentPaymentsContainer, IStudentsUtils
    5252    )
    5353from waeup.kofa.utils.helpers import get_fileformat
     
    803803    upload_button =_('Upload new file')
    804804    delete_button = _('Delete attachment')
    805     show_viewlet = True
     805
     806    @property
     807    def show_viewlet(self):
     808        students_utils = getUtility(IStudentsUtils)
     809        if self.__name__ in students_utils.SKIP_UPLOAD_VIEWLETS:
     810            return False
     811        return True
    806812
    807813    @property
Note: See TracChangeset for help on using the changeset viewer.