Package omeroweb :: Package webclient :: Package controller :: Module basket
[hide private]
[frames] | no frames]

Source Code for Module omeroweb.webclient.controller.basket

 1  #!/usr/bin/env python 
 2  # -*- coding: utf-8 -*- 
 3  #  
 4  #  
 5  #  
 6  # Copyright (c) 2008-2011 University of Dundee. 
 7  #  
 8  # This program is free software: you can redistribute it and/or modify 
 9  # it under the terms of the GNU Affero General Public License as 
10  # published by the Free Software Foundation, either version 3 of the 
11  # License, or (at your option) any later version. 
12  #  
13  # This program is distributed in the hope that it will be useful, 
14  # but WITHOUT ANY WARRANTY; without even the implied warranty of 
15  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
16  # GNU Affero General Public License for more details. 
17  #  
18  # You should have received a copy of the GNU Affero General Public License 
19  # along with this program.  If not, see <http://www.gnu.org/licenses/>. 
20  #  
21  # Author: Aleksandra Tarkowska <A(dot)Tarkowska(at)dundee(dot)ac(dot)uk>, 2008. 
22  #  
23  # Version: 1.0 
24  # 
25   
26  from django.core.urlresolvers import reverse 
27   
28  from webclient.controller import BaseController 
29   
30 -class BaseBasket(BaseController):
31 32 imageInBasket = None 33 34 imgSize = 0 35 dsSize = 0 36 prSize = 0 37 sizeOfBasket = 0 38
39 - def __init__(self, conn, **kw):
41
42 - def load_basket(self, request):
43 imInBasket = list() 44 dsInBasket = list() 45 prInBasket = list() 46 47 for imgId in request.session['imageInBasket']: 48 imInBasket.append(imgId) 49 #for dsId in request.session['datasetInBasket']: 50 # dsInBasket.append(dsId) 51 52 if len(imInBasket) > 0: 53 self.imageInBasket = list(self.conn.getObjects("Image", imInBasket)) 54 self.imgSize = len(self.imageInBasket) 55 #if len(dsInBasket) > 0: 56 # self.datasetInBasket = list(self.conn.getDatasetsWithImages(dsInBasket)) 57 # self.dsSize = len(self.datasetInBasket) 58 self.sizeOfBasket = self.imgSize#+self.dsSize
59