예제 #1
0
파일: states.py 프로젝트: asley/schooltool
 def app_states(self):
     app = ISchoolToolApplication(None)
     container = IRelationshipStateContainer(app)
     states = container.get(self.view.app_states_name, None)
     if states is None:
         return {}
     return states
예제 #2
0
 def app_states(self):
     app = ISchoolToolApplication(None)
     container = IRelationshipStateContainer(app)
     states = container.get(self.view.app_states_name, None)
     if states is None:
         return {}
     return states
예제 #3
0
 def getVocabulary(self):
     app = ISchoolToolApplication(None)
     container = IRelationshipStateContainer(app)
     relationships = container.get(self.field.source)
     terms = [
         zope.schema.vocabulary.SimpleTerm(
             state, token=state.__name__, title=state.title)
         for state in relationships.states.values()]
     vocabulary = zope.schema.vocabulary.SimpleVocabulary(terms)
     return vocabulary
예제 #4
0
 def getVocabulary(self):
     app = ISchoolToolApplication(None)
     container = IRelationshipStateContainer(app)
     relationships = container.get(self.field.source)
     terms = [
         zope.schema.vocabulary.SimpleTerm(state,
                                           token=state.__name__,
                                           title=state.title)
         for state in relationships.states.values()
     ]
     vocabulary = zope.schema.vocabulary.SimpleVocabulary(terms)
     return vocabulary
예제 #5
0
파일: states.py 프로젝트: asley/schooltool
 def states(self):
     if self.app_states_name is None:
         return None
     app = ISchoolToolApplication(None)
     container = IRelationshipStateContainer(app)
     return container.get(self.app_states_name, None)
예제 #6
0
 def states(self):
     if self.app_states_name is None:
         return None
     app = ISchoolToolApplication(None)
     container = IRelationshipStateContainer(app)
     return container.get(self.app_states_name, None)