Ignore:
Timestamp:
25 Apr 2009, 13:48:19 (16 years ago)
Author:
uli
Message:

Make a real factory for student containers.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • waeup/branches/ulif-rewrite/src/waeup/student/studentcontainer.py

    r3951 r4083  
    11import grok
    22import os
     3from zope.component.interfaces import IFactory
     4from zope.interface import implementedBy
    35from waeup.interfaces import IStudentContainer
    46from waeup.utils import importexport as csv
     
    1113    grok.implements(IStudentContainer)
    1214   
     15class StudentContainerFactory(grok.GlobalUtility):
     16    """A factory for faculty containers.
     17    """
     18    grok.implements(IFactory)
     19    grok.name(u'waeup.StudentContainer')
     20    title = u"Create a new student container.",
     21    description = u"This factory instantiates new student containers."
     22
     23    def __call__(self):
     24        return StudentContainer()
     25
     26    def getInterfaces(self):
     27        return implementedBy(StudentContainer)
    1328   
    1429class Import(grok.View):
     
    3853        csv.writeFile(result)
    3954        return "yeah %s" % t[0]
    40 
    41 grok.global_utility(StudentContainer, provides=IStudentContainer)
Note: See TracChangeset for help on using the changeset viewer.