Exemplo n.º 1
0
 def get( self ):
     self.SetTemplate(handlerType, 'admin_ListUsers.html')
     if self.User and self.User.IsAdmin:
         offset = self.request.get( 'Offset' ) or 0
         result = Person.all().fetch( limit=30, offset=offset )
         self.respond( locals() )
     else:
         self.status = 'You Must be Loged in as administrator in order to list the users'
         self.redirect( LoginHandler.get_url() )
Exemplo n.º 2
0
	def get(self, *args):
		allUsers = Person.all()
		ownerAccount = None
		isCash = False
		if self.g('OwnerAccount'):
			if self.g('op') == 'new':
				ownerAccount = am.Account.get(self.g('OwnerAccount'))
				if str(ownerAccount.Owner.key()) != str(self.User.key()):
					ownerAccount = None
			elif self.g('op') == 'search':
				allUsers = Person.all()
				self.respond(locals())
			elif self.g('op') == 'cash':
				IsCash=True
			self.respond(locals())
		else:
			self.status = message.invalid_data_passed
			self.redirect(AccountHandler.get_url())
Exemplo n.º 3
0
	def get(self):
		result = None
		if self.User:
			if self.User.owner_accounts.get():
				transaction_results = self.User.owner_accounts.get().owner_account_transactions.fetch(limit=10)
			allUsers = Person.all()
			self.respond(locals())
		else:
			self.status = 'You Must be LogedIn in order to see your Balance'
			self.redirect(LoginHandler.get_url())
Exemplo n.º 4
0
 def get(self):
     if(self.User and self.User.IsAdmin):
         g = self.request.get
         if(g('search')):
             query = Person.all()
             #query.filter('Name=', g('search'))
             self.respond({'result':query.fetch(limit=100)})  
             #self.response.out.write(str(query.fetch(limit=20)))
         else:
             self.respond()
     else:
         self.redirect(LoginHandler.get_url())
Exemplo n.º 5
0
 def get(self):
     if(self.User and self.User.IsAdmin):
         if(self.g('search')):
             query = Person.all()
             #query.filter('Name=', g('search'))
             self.respond({'result':query.fetch(limit=100)})  
             #self.response.out.write(str(query.fetch(limit=20)))
         else:
             self.respond()
     else:
         self.status = messages.not_allowed_to_access
         self.redirect(LoginHandler.get_url())
Exemplo n.º 6
0
 def get(self):
     if(self.User and self.User.IsAdmin):
         g = self.request.get
         
         if(g('search')):
             query = Person.all()
             query.filter('Name=', g('search'))
             persons = query.fetch(limit=100)
             self.respond({'result':persons})  
         else:
             self.respond()
     else:
         self.redirect(LoginHandler.get_url())
Exemplo n.º 7
0
	def base_params(self):
		financialCard = None
		refUser = None
		allUsers = Person.all().fetch(100)
		if self.g('UserKey'):
			refUser = Person.get(self.request.get('UserKey'))
			if refUser:
				financialCard = am.FinancialCard.GetByOwnerByUser(self.User, refUser)	
				#if there is no initial balance or recalculation is asked , run recalculate
				if financialCard and (financialCard.Balance == None or (self.g('op') and self.g('op') == 'recalc')):
					financialCard.Recalculate(True)
			else:
				self.status = 'There is not transaction card for this User'
		else:
			self.status = 'Invalid Data'
		return {"financialCard":financialCard, "refUser":refUser, "allUsers":allUsers}
Exemplo n.º 8
0
	def get(self, *args):
		result = None
		if self.User.owner_accounts.get():
			transaction_results = self.User.owner_accounts.get().owner_account_transactions.fetch(limit=10)
		allUsers = Person.all()
		self.respond(locals())