コード例 #1
0
ファイル: profiles.py プロジェクト: filipmares/SynapSync
	def get(self):
	
		datastore = DataStoreInterface()
		formatter = StringFormatter()
		
		path = self.request.query_string.replace('company=', '')
		posts = datastore.getPosts(path, 25)
		companies = datastore.getCompanyInfo(path) 
		company = datastore.getCompanyName(path)
		
		info=''
		for c in companies:
			info = formatter.formatCompanyInfo(c)
				
		postList=[]
		for p in posts:
			postList.append(formatter.formatPost(p, p.dbProfileName))
		render.doRender(self, 'profiles.html', {'posts': postList, 'company': company , 'info': info, 'profileName' : path})
コード例 #2
0
ファイル: settings.py プロジェクト: filipmares/SynapSync
	def get(self):
		self.session = Session()

		if 'user' in self.session:
			formatter = StringFormatter()
			user = self.session['user']	
			company = formatter.getCompanyProfileName(user)
			email = formatter.getEmail(user)

			datastore = DataStoreInterface()
			twitterAccounts = datastore.getTwitterAccounts(company)
			facebookAccounts = datastore.getFacebookAccounts(company)
			
			uInfo = datastore.getUserInfo(email)
			
			for u in uInfo:
				firstName = u.dbFirstName 
				lastName = u.dbLastName
				
				
			
			cInfo = datastore.getCompanyInfo(company)
			
			for c in cInfo:
				cname = c.dbCompanyName
				stAddress = c.dbStreetAddress
				city = c.dbCity
				state = c.dbState
				zip = c.dbPostalCode
				country = c.dbCountry
				number = c.dbPhoneNumber
				cemail = c.dbAdministrator
				website = c.dbUrl

			if datastore.isAdmin(company, email) == 1:
				render.doRender(self, 'settings.html', {'isAdmin':email,'email':email,'firstName':firstName, 'lastName':lastName, 'socialAccounts' : twitterAccounts
													    ,'facebookAccounts':facebookAccounts, 'cname':cname, 'stAddress':stAddress, 'city':city, 'state':state, 'zip':zip
													    ,'country':country, 'number':number, 'cemail':cemail, 'website':website })
			else:
				render.doRender(self, 'settings.html', {'email':email})
		else:
			render.doRender(self, 'main.html', {})