Changeset 0d29a2 in indico


Ignore:
Timestamp:
02/04/10 18:43:18 (3 years ago)
Author:
Pedro Ferreira <jose.pedro.ferreira@…>
Branches:
master, burotel, hello-world-walkthrough, ipv6, new-webex, prov-dual-interface, v0.97-series, v0.98-series, v0.98.2, v0.98.3, v0.98b1, v0.98b2, v0.99, 051b2622c51afb171a1dedb46a0df4fbb0cbd02e, 0da0c1403bae8e51d8229f460181c71b9e6dda72
Children:
8f6f66, f3d0f4
Parents:
9161a3
git-author:
Pedro Ferreira <jose.pedro.ferreira@…> (02/04/10 18:41:32)
git-committer:
Pedro Ferreira <jose.pedro.ferreira@…> (02/04/10 18:43:18)
Message:

[FIX] Issue with material registries

  • Certain datatypes don't contain all the material types that Contribution contains;
  • Material registries should be a target of refactoring in the future;.
Location:
indico/MaKaC
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • indico/MaKaC/conference.py

    rf6f550 r0d29a2  
    401401        recMat.recover() 
    402402        self.notifyModification() 
     403 
     404    def getMaterialRegistry(self): 
     405        """ 
     406        Return the correct material registry for this type 
     407        """ 
     408        from MaKaC.webinterface.materialFactories import CategoryMFRegistry 
     409        return CategoryMFRegistry 
    403410 
    404411    def getMaterialById( self, matId ): 
     
    40454052        self.notifyModification() 
    40464053 
     4054    def getMaterialRegistry(self): 
     4055        """ 
     4056        Return the correct material registry for this type 
     4057        """ 
     4058        from MaKaC.webinterface.materialFactories import ConfMFRegistry 
     4059        return ConfMFRegistry 
     4060 
    40474061    def getMaterialById( self, matId ): 
    40484062        if matId.lower() == 'paper': 
     
    64856499        self.notifyModification() 
    64866500 
     6501    def getMaterialRegistry(self): 
     6502        """ 
     6503        Return the correct material registry for this type 
     6504        """ 
     6505        from MaKaC.webinterface.materialFactories import SessionMFRegistry 
     6506        return SessionMFRegistry 
     6507 
    64876508    def getMaterialById( self, matId ): 
    64886509        if matId.lower() == 'minutes': 
     
    92169237        self.notifyModification() 
    92179238 
     9239    def getMaterialRegistry(self): 
     9240        """ 
     9241        Return the correct material registry for this type 
     9242        """ 
     9243        from MaKaC.webinterface.materialFactories import ContribMFRegistry 
     9244        return ContribMFRegistry 
     9245 
    92189246    def getMaterialById( self, matId ): 
    92199247        if matId.lower() == 'paper': 
     
    1048310511        self.notifyModification() 
    1048410512 
     10513    def getMaterialRegistry(self): 
     10514        """ 
     10515        Return the correct material registry for this type 
     10516        """ 
     10517        from MaKaC.webinterface.materialFactories import SubContributionMFRegistry 
     10518        return SubContributionMFRegistry 
     10519 
    1048510520    def getMaterialById( self, matId ): 
    1048610521        if matId.lower() == 'paper': 
  • indico/MaKaC/webinterface/materialFactories.py

    rdebb1b r0d29a2  
    2020## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. 
    2121 
     22import MaKaC.conference as conference 
    2223import MaKaC.webinterface.urlHandlers as urlHandlers 
    2324import MaKaC.webinterface.wcomponents as wcomponents 
    24 import MaKaC.conference as conference 
    2525from MaKaC.common.Configuration import Config 
    2626from MaKaC.i18n import _ 
     
    399399        for factory in cls._registry.values(): 
    400400            if factory.appliesToMaterial(mat): 
    401                 return factory             
     401                return factory 
    402402 
    403403 
     
    409409                  VideoFactory._id: VideoFactory, \ 
    410410                  PosterFactory._id: PosterFactory } 
    411  
    412411 
    413412class SessionMFRegistry( MaterialFactoryRegistry ): 
     
    422421                  PosterFactory._id: PosterFactory } 
    423422 
    424  
     423class CategoryMFRegistry( ContribMFRegistry ): 
     424    pass 
     425 
     426class SubContributionMFRegistry( ContribMFRegistry ): 
     427    pass 
  • indico/MaKaC/webinterface/rh/conferenceBase.py

    r0f1000 r0d29a2  
    282282        """ 
    283283         
    284         mf = materialFactories.ContribMFRegistry.getById(self._materialId) 
     284        mf = self._target.getMaterialRegistry().getById(self._materialId) 
    285285 
    286286        material = mf.get(self._target) 
Note: See TracChangeset for help on using the changeset viewer.