Esempio n. 1
0
 def view_mosaic(self,request,objlist=None,other=None):
     if 'user' in request.session: u = user(request.session['user'])
     else: u = user('efforia')
     try: page = request.GET.get('page',1)
     except PageNotAnInteger: page = 1
     if objlist is None: f = self.feed(u)
     else: f = objlist
     if other is None: p = u.profile
     else: p = other 
     f.sort(key=lambda item:item.date,reverse=True)
     p = Paginator(f,20,request=request)
     try: objects = p.page(page)
     except EmptyPage: return response('End of feed')
     rendered = self.apps_mosaic(request,objects,p)
     return response(rendered,content_type='text/html')
Esempio n. 2
0
 def view_mosaic(self,request,objlist=None,other=None):
     if 'user' in request.session: u = user(request.session['user'])
     else: u = user('efforia')
     try: page = request.GET.get('page',1)
     except PageNotAnInteger: page = 1
     if objlist is None: f = self.feed(u)
     else: f = objlist
     if other is None: p = u.profile
     else: p = other 
     f.sort(key=lambda item:item.date,reverse=True)
     p = Paginator(f,20,request=request)
     try: objects = p.page(page)
     except EmptyPage: return response('End of feed')
     apps = settings.EFFORIA_APPS
     return render(request,'grid.jade',{'f':objects,'p':p,'path':request.path,'apps':apps,
                                        'static_url':settings.STATIC_URL},content_type='text/html')