Example #1
0
	def __init__(self, userID):
		lensList = getUserBagList(userID)
		haveList = []
		wantList = []
		for lens in lensList:
			if lens.bagStatus == 'haveIt':
				haveList.append(getLens(lens.lensID))
			elif lens.bagStatus == 'wantIt':
				wantList.append(getLens(lens.lensID))
		self.want = appendStats(wantList)
		self.have = appendStats(haveList)
Example #2
0
 def get(self, lensID):
     localUser = localUsers.localUser() 
     lens = getLens(lensID)  
     lensStats = renderClasses.lensStats(lensID) 
     sortMethod = self.request.get('sortMethod')
     activeTab = self.request.get('activeTab')        
     if lens is not None:       
         self.render('lensPage.html', 
             lens = lens,
             lensStats = renderClasses.lensStats(lensID),  
             userComment = renderClasses.userComment(lensID, localUser),               
             comments = renderClasses.threeColumns(lensID, localUser, sortMethod=sortMethod),
             activePill = renderClasses.activePill(sortMethod),
             activeTab = renderClasses.activeTab(activeTab),
             uses = renderClasses.lensUses(lensID),
             userUses = renderClasses.userUses(lensID, localUser),
             lensStatus = userBag.lensStatus(localUser, lensID = lensID))
     else:
         self.redirect('/')
Example #3
0
	def __init__(self, comment, localUser):
		self.comment = formatComment(comment, localUser)
		lens = getLens(comment.lensID)
		lens.stats = lensStats(lens.id)
		self.lens = lens