예제 #1
0
 def get_infoblock(self, name):
     request = RequestFactory().get("/")
     request.user = AnonymousUser()
     for infoblock in PersonalInfo.get_all(request):
         if type(infoblock).__name__ == name:
             value = infoblock
             break
     else:
         value = False
     return value
예제 #2
0
 def get_infoblock(self, name):
     request = RequestFactory().get('/')
     request.user = AnonymousUser()
     for infoblock in PersonalInfo.get_all(request):
         if type(infoblock).__name__ == name:
             value = infoblock
             break
     else:
         value = False
     return value
예제 #3
0
 def is_active(self):
     """
     The widget is disabled if there are no info blocks at the moment.
     """
     for infoblock in PersonalInfo.get_all(self.request):
         if infoblock.is_active():
             active = super(PersonalInfoWidget, self).is_active()
             break
     else:
         active = False
     return active
예제 #4
0
 def is_active(self):
     """
     The widget is disabled if there are no info blocks at the moment.
     """
     for infoblock in PersonalInfo.get_all(self.request):
         if infoblock.is_active():
             active = super(PersonalInfoWidget, self).is_active()
             break
     else:
         active = False
     return active
예제 #5
0
 def get_context_data(self, **context):
     """
     Adds the context to the widget.
     """
     return super(PersonalInfoWidget, self).get_context_data(infoblocks=PersonalInfo.get_all(self.request), **context)
예제 #6
0
 def get_context_data(self, **context):
     """
     Adds the context to the widget.
     """
     return super(PersonalInfoWidget, self).get_context_data(
         infoblocks=PersonalInfo.get_all(self.request), **context)