app/soc/modules/ghop/callback.py
changeset 2787 8408741aee63
parent 2785 bb6064b9fc9d
child 2895 cad75f6ba411
equal deleted inserted replaced
2786:b06313c87817 2787:8408741aee63
    19   '"Madhusudan C.S." <madhusudancs@gmail.com>',
    19   '"Madhusudan C.S." <madhusudancs@gmail.com>',
    20   '"Lennard de Rijk" <ljvderijk@gmail.com>',
    20   '"Lennard de Rijk" <ljvderijk@gmail.com>',
    21   ]
    21   ]
    22 
    22 
    23 
    23 
    24 from soc.modules.ghop.views.models import organization
       
    25 from soc.modules.ghop.views.models import program
       
    26 from soc.modules.ghop.views.models import timeline
       
    27 
       
    28 
       
    29 class Callback(object):
    24 class Callback(object):
    30   """Callback object that handles interaction between the core.
    25   """Callback object that handles interaction between the core.
    31   """
    26   """
    32 
    27 
    33   API_VERSION = 1
    28   API_VERSION = 1
    42     """Called by the server when sitemap entries should be registered.
    37     """Called by the server when sitemap entries should be registered.
    43     """
    38     """
    44 
    39 
    45     self.core.requireUniqueService('registerWithSitemap')
    40     self.core.requireUniqueService('registerWithSitemap')
    46 
    41 
    47     self.core.registerSitemapEntry(organization.view.getDjangoURLPatterns())
       
    48     self.core.registerSitemapEntry(program.view.getDjangoURLPatterns())
       
    49     self.core.registerSitemapEntry(timeline.view.getDjangoURLPatterns())
       
    50 
       
    51   def registerWithSidebar(self):
    42   def registerWithSidebar(self):
    52     """Called by the server when sidebar entries should be registered.
    43     """Called by the server when sidebar entries should be registered.
    53     """
    44     """
    54 
    45 
    55     # require that we had the chance to register the urls we need with the sitemap
    46     # require that we had the chance to register the urls we need with the sitemap
    56     self.core.requireUniqueService('registerWithSidebar')
    47     self.core.requireUniqueService('registerWithSidebar')
    57 
       
    58     self.core.registerSidebarEntry(organization.view.getExtraMenus)
       
    59     self.core.registerSidebarEntry(organization.view.getSidebarMenus)
       
    60     self.core.registerSidebarEntry(program.view.getSidebarMenus)