EduploneExam ExamFolder.py,1.2,1.3 registry.py,1.2,1.3 version.txt,1.1,1.2

Jens Klein <[email protected]>
Newsgroups gmane.comp.web.zope.eduplone.cvs
Message-ID <[email protected]>
Update of /cvsroot/eduplone/EduploneExam
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28784

Modified Files:
	ExamFolder.py registry.py version.txt 
Log Message:
new  agx run, modified model


Index: registry.py
===================================================================
RCS file: /cvsroot/eduplone/EduploneExam/registry.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** registry.py	14 Dec 2004 12:42:53 -0000	1.2
--- registry.py	14 Dec 2004 13:09:57 -0000	1.3
***************
*** 28,32 ****
  __docformat__ = 'plaintext'
  
! _question_types = []
  
  from interfaces.IExamQuestion import IExamQuestion
--- 28,32 ----
  __docformat__ = 'plaintext'
  
! _question_types = {}
  
  from interfaces.IExamQuestion import IExamQuestion
***************
*** 36,42 ****
      if not IExamQuestion.isImplementedByInstancesOf(klass):
          raise NotImplementedError('The class %s does not implement interface IExamQuestion' % klass.__name__)
!     if not klass.__name__ in _question_types:
!         _question_types.append(klass.__name__)
  
  def getQuestionTypes():
!     return _question_types
--- 36,42 ----
      if not IExamQuestion.isImplementedByInstancesOf(klass):
          raise NotImplementedError('The class %s does not implement interface IExamQuestion' % klass.__name__)
!     if not klass.__name__ in _question_types.keys():
!         _question_types[klass.__name__]=klass
  
  def getQuestionTypes():
!     return _question_types.copy()

Index: version.txt
===================================================================
RCS file: /cvsroot/eduplone/EduploneExam/version.txt,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** version.txt	14 Dec 2004 09:47:47 -0000	1.1
--- version.txt	14 Dec 2004 13:09:57 -0000	1.2
***************
*** 1 ****
! 0.1 build 1
--- 1 ----
! 0.1 build 3

Index: ExamFolder.py
===================================================================
RCS file: /cvsroot/eduplone/EduploneExam/ExamFolder.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** ExamFolder.py	14 Dec 2004 10:31:39 -0000	1.2
--- ExamFolder.py	14 Dec 2004 13:09:57 -0000	1.3
***************
*** 8,12 ****
  # by FH-Aargau, Switzerland
  #
! # Generated: Tue Dec 14 10:39:59 2004
  # Generator: ArchGenXML Version 1.2 devel 3 http://sf.net/projects/archetypes/
  #
--- 8,12 ----
  # by FH-Aargau, Switzerland
  #
! # Generated: Tue Dec 14 14:00:03 2004
  # Generator: ArchGenXML Version 1.2 devel 3 http://sf.net/projects/archetypes/
  #
***************
*** 37,41 ****
  
  
! class ExamFolder(BaseFolder):
      security = ClassSecurityInfo()
      portal_type = meta_type = 'ExamFolder'
--- 37,41 ----
  
  
! class ExamFolder(OrderedBaseFolder):
      security = ClassSecurityInfo()
      portal_type = meta_type = 'ExamFolder'
***************
*** 43,47 ****
      allowed_content_types = []
  
!     __implements__ = getattr(BaseFolder,'__implements__',())
  
      ##code-section class-header #fill in your manual code here
--- 43,47 ----
      allowed_content_types = []
  
!     __implements__ = getattr(OrderedBaseFolder,'__implements__',())
  
      ##code-section class-header #fill in your manual code here
***************
*** 75,91 ****
  
      def allowedContentTypes(self):
!         '''
! 
!         '''
! 
!         pass
  
  
      def invokeFactory(self):
!         '''
  
!         '''
  
!         pass
  
  
--- 75,105 ----
  
      def allowedContentTypes(self):
!         """ use own registry to recognize allowed tpyes """
!         tt = getToolByName(self,'portal_types')
!         qtypes = getQuestionTypes()
!         allowed = [tt[tn] for tn in \
!                     [qtypes[key].meta_type \
!                      for key in qtypes]\
!                   ]
!         return allowed
  
  
      def invokeFactory(self):
!         """ Invokes the portal_types tool """
!         try:
!             return OrderedBaseFolder.invokeFactory(self, type_name, id, RESPONSE=None, *args, **kw)
!         except:
!             self.updateRegisteredTypes()
!             return OrderedBaseFolder.invokeFactory(self, type_name, id, RESPONSE=None, *args, **kw)
  
!     #manually created methods
  
!     def updateRegisteredTypes(self):
!         """ updates own fti based on registered containers """
!         tt = getToolByName(self,'portal_types')
!         ti = tt[self.meta_type]
!         qtypes = getQuestionTypes()
!         allowedmetatypes = [qtypes[key].meta_type for key in qtypes]
!         ti.allowed_content_types=tuple(allowedmetatypes)
  
  



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.