def all_sheds(request): if request.user.is_anonymous(): return HttpResponseRedirect('/accounts/login') else: userProfile = profileUtil.getProfileFromUser(request.user) allSheds = shedUtil.getAllShedsAllSharezones() shedsInMySharezone = shedUtil.getAllShedsInSharezone(userProfile.sharezone) adminSheds = shedUtil.getAllShedsAdministratedBy(userProfile) ownedSheds = shedUtil.getAllShedsOwnedBy(userProfile) memberSheds = shedUtil.getAllShedsJoinedBy(userProfile) context = {} context.update(csrf(request)) context['sheds'] = allSheds context['adminSheds'] = adminSheds context['ownedSheds'] = ownedSheds context['mySheds'] = memberSheds context.update(content.genBaseLoggedIn(request)) return render_to_response('all_sheds.html', context)
def view_community_page(request, sharezone): if request.user.is_anonymous(): return HttpResponseRedirect("/accounts/login") else: if sharezone is not None: sheds = shedUtil.getAllShedsInSharezone(sharezone) users = profileUtil.getAllProfilesInSharezone(sharezone) context = {} context['sharezone'] = sharezone context['sheds'] = sheds context['users'] = users context.update(content.genBaseLoggedIn(request)) return render_to_response('community_page.html', context) else: context = {} context['object'] = 'community' context.update(content.genBaseLoggedIn(request)) return render_to_response('dne.html', context)
def all_sheds(request): if request.user.is_anonymous(): return HttpResponseRedirect('/accounts/login') else: userProfile = profileUtil.getProfileFromUser(request.user) allSheds = shedUtil.getAllShedsAllSharezones() shedsInMySharezone = shedUtil.getAllShedsInSharezone( userProfile.sharezone) adminSheds = shedUtil.getAllShedsAdministratedBy(userProfile) ownedSheds = shedUtil.getAllShedsOwnedBy(userProfile) memberSheds = shedUtil.getAllShedsJoinedBy(userProfile) context = {} context.update(csrf(request)) context['sheds'] = allSheds context['adminSheds'] = adminSheds context['ownedSheds'] = ownedSheds context['mySheds'] = memberSheds context.update(content.genBaseLoggedIn(request)) return render_to_response('all_sheds.html', context)
def test_GetAllShedsInSharezone(self): """ """ self.assertIn( self.getShed, shedUtils.getAllShedsInSharezone("Coruscant") ) #make sure the shed is returned when doing a query of all sheds in zone
def test_GetAllShedsInSharezone(self): """ """ self.assertIn (self.getShed, shedUtils.getAllShedsInSharezone ("Coruscant")) #make sure the shed is returned when doing a query of all sheds in zone