コード例 #1
0
ファイル: cmsHandlers.py プロジェクト: Halicea/HaliceaCMS
 def get(self, pagepath):
     lnk = cms.CMSLink.GetLinkByPath(pagepath)
     if lnk:
         self.respond({"link": lnk})
     else:
         self.status = "Not Valid Page"
         self.redirect(LoginHandler.get_url())
コード例 #2
0
ファイル: cmsHandlers.py プロジェクト: Halicea/HaliceaCMS
 def post(self, *args):
     if self.g("op"):
         if self.g("op") == "add":
             addressName = self.g("addressName")
             name = self.g("name")
             parent = self.g("parentLink")
             if parent:
                 parent = cms.CMSLink.get(parent)
             else:
                 parent = None
             order = int(self.g("order"))
             content = self.g("content")
             if content:
                 content = cms.CMSContent.get(content)
             creator = self.User
             cms.CMSLink.CreateNew(addressName, name, parent, order, content, creator, _isAutoInsert=True)
         elif self.g("op") == "del":
             lnk = cms.CMSLink.get(self.g("key"))
             if lnk:
                 if lnk.Content.content_cms_links.count() == 1:
                     lnk.Content.delete()
                 lnk.delete()
             else:
                 self.status = "Link is invalid"
                 self.redirect(LoginHandler.get_url())
     if not self.isAjax:
         cmsLinks = cms.CMSLink.GetLinkTree()
         #            yaml.load()
         contents = cms.CMSContent.all().fetch(limit=1000, offset=0)
         self.respond({"cmsLinks": cmsLinks, "contents": contents})
コード例 #3
0
	def get(self, verification_key):
		verification = am.TransactionVerificationRequest.get(verification_key)
		#change the user login now
		if verification and verification.Reciever != self.User:
			self.User = verification.Reciever
		if self.User and verification:
			if self.request.get('yesno'):
				accept = self.request.get('yesno') == 'true'
				tr = verification.Transaction
				tr.Verified = accept
				tr.save()
				verification.delete()
				self.status = 'Transaction is Updated as ' + str(accept)
				self.redirect(TransactionHandler.get_url())
			else:
				self.status = 'You Must Choose whether you accept or reject the Transaction'
				self.redirect(TransactionHandler.get_url() + '?op=new')
		else:
			if not self.User:
				self.status = 'You must be loged in in order to verify some transaction!'
				self.redirect(LoginHandler.get_url(), permanent=False)
			elif verification:
				self.status = 'Verification is not instantiated'
				self.redirect(TransactionHandler.get_url())
			else:
				self.status = 'You\'re loged in as other User so you\'ve been loged out and then loged in as'
コード例 #4
0
ファイル: cmsHandlers.py プロジェクト: Halicea/VlachYouthWeb
 def post(self):
     if self.User and self.User.IsAdmin:
         if self.g('op'):
             if self.g('op')=='add':
                 addressName = self.g('addressName')
                 name = self.g('name')
                 parent=self.g('parentLink')
                 if parent:
                     parent = cms.CMSLink.get(parent)
                 else: 
                     parent = None
                 order= int(self.g('order'))
                 content=self.g('content')
                 if content:
                     content = cms.CMSContent.get(content)
                 creator= self.User
                 cms.CMSLink.CreateNew(addressName, name, parent, order, content, creator, _isAutoInsert=True)
             elif self.g('op')=='del':
                 lnk=cms.CMSLink.get(self.g('key'))
                 if lnk:
                     if lnk.Content.content_cms_links.count()==1:
                         lnk.Content.delete()
                     lnk.delete()
                 else:
                     self.status="Link is invalid";
                     self.redirect(LoginHandler.get_url())
         if not self.isAjax:
             cmsLinks = cms.CMSLink.GetLinkTree()
             yaml.load()                
             contents = cms.CMSContent.all().fetch(limit=1000, offset=0)
             self.respond({'cmsLinks':cmsLinks, 'contents':contents})
     else:
         self.status = messages.not_allowed_to_access
         self.respond('/Login')
コード例 #5
0
ファイル: cmsHandlers.py プロジェクト: Halicea/HaliceaCMS
 def get(self, *args):
     self.SetTemplate(handlerType, "CMSContent.html")
     if self.User and self.User.IsAdmin:
         contents = cms.CMSContent.all().fetch(limit=1000, offset=0)
         self.respond({"contents": contents})
     else:
         self.status = messages.not_allowed_to_access
         self.redirect(LoginHandler.get_url())
コード例 #6
0
 def get(self):
     self.SetTemplate(handlerType,'admin_ListUsers.html')
     if(self.User and self.User.IsAdmin):
         querry = Person.gql("WHERE IsAdmin =:v", v=True)
         result=querry.fetch(1000)
         self.respond({'result':result})
     else:
         self.status(messages.not_allowed_to_access)
         self.redirect(LoginHandler.get_url())
コード例 #7
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() )
コード例 #8
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())
コード例 #9
0
 def get(self):
     g = self.request.get        
     if(self.User and self.User.IsAdmin):
         if(g('UserName')):
             u = Admin(userId=g('UserName'))
             db.put(u)
             self.respond({'laStatus':'Successfuly saved the Admin ' + g('UserName')})
         else:    
             self.respond()  
     else:
         self.redirect(LoginHandler.get_url())
コード例 #10
0
	def get(self):
		local = {}
		if self.User:
			if self.g("key"):
				acc = am.Account.get(self.g('key'))
				if acc:
					local["currentAccount"] = AccountForm(data = acc)
			self.respond(local)
		else:
			self.status = message.must_be_loged
			self.redirect(LoginHandler.get_url())
コード例 #11
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())
コード例 #12
0
ファイル: adminHandlers.py プロジェクト: Halicea/HaliceaCMS
 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())
コード例 #13
0
 def get(self, langCode):
     if self.User and self.User.IsAdmin:
         if self.isAjax:
             self.SetTemplate(handlerType, "dict_AddDictionaryItem.inc.html")
         value, description, vItemCode = self.g("value"), self.g("description"), self.g("vItemCode")
         word = self.AddDictionaryItem(vItemCode, langCode, value, description)
         if word:
             self.status = "word is added!"
         else:
             self.status = "word is not added"
         self.respond({"new_word": word})
     else:
         self.redirect(LoginHandler.get_url())
コード例 #14
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())
コード例 #15
0
	def post(self):
		if self.User:
			d = self.base_params()
			if self.request.get('UserKey'):
				if self.request.get('From') and self.request.get('From'):
					zd = Person.get(self.request.get('UserKey'))
					#search_result = am.Dolg.gql( 'WHERE (zel = :zd OR dal = :zd) AND owner:ow', zd=zd, ow=self.User ).fetch( limit=100 )
					transaction_results = am.Transaction.all().filter('OwnerAccouny=', self.User).filter('ReferentAccouny=', zd).fetch(limit=100)
					#search_result = db.GqlQuery("SELECT * FROM Dolg WHERE owner= :1 AND (zel= :2 OR dal= :2)", self.User, zd)
					d['transaction_results'] = transaction_results
					self.respond(d)
		else:
			self.status = 'You must be loged in in order to use the Accounting Service'
			self.redirect(LoginHandler.get_url())
コード例 #16
0
	def post(self):
		if self.User:
			result, notify, message = self.validate_retrieve()
			if result:
				#if notify:
				#	self.notify_second_party(result)
				self.status = "The transaction is added!"
				self.redirect(UserTransactionListHandler.get_url())
			else:
				self.status = 'You did not passed valid parameters, Message:' + message
				self.respond(locals())
		else:
			self.status = 'You Must be loged in in order to manage your Account'
			self.redirect(LoginHandler.get_url())
コード例 #17
0
ファイル: postHandlers.py プロジェクト: Halicea/HaliceaCMS
 def get(self, test):
     self.Template = 'post_AddQuote.html'
     if self.User and self.User.IsAdmin:
         if self.request.get('Quote'):
             quote = bm.Quote(
                      QuoteText=self.request.get('Quote'),
                      Author=self.User,
                      CreatedOn=dt.datetime.today(),
                      PublishDate=dt.datetime.today()
                      )
             quote.put()
         else:
             self.respond()
     else:
         self.status = 'You must be administrator in order to create a quote'
         self.redirect(LoginHandler.get_url())
コード例 #18
0
	def get(self):
		allUsers = Person.all()
		ownerAccount = None
		isCash = False
		if self.User:
			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())
		else:
			self.status = message.must_be_loged
			self.redirect(LoginHandler.get_url())
コード例 #19
0
	def post(self):
		#self.TemplateType="accounting"
		#import rpdb2; rpdb2.start_embedded_debugger('test')
		if self.User:
			if self.g('op') == 'new':
				form=AccountForm(self.request.POST)
				if form.is_valid():
					result=form.save(commit=False)
					result.put()
				#accountNumber = self.g("AccountNumber")
				#bankName = self.g("BankName")
				#balance = float(self.g("Balance"))
				#owner = self.User
				#if accountNumber and bankName and balance:
					self.status = message.item_is_saved
				#	am.Account.CreateNew(accountNumber, bankName, owner, balance, _isAutoSave=True)
				else:
					self.status = message.invalid_data_passed+ '</br>' + str(form.AccountNumber) + str(form.BankName)+str(form.Balance) 
			self.respond()
		else:
			self.status = message.must_be_loged
			self.redirect(LoginHandler.get_url())
コード例 #20
0
	def redirect_login(self):
		self.redirect(LoginHandler.get_url())
コード例 #21
0
	def get(self):
		if self.User:
			self.respond(self.base_params())
		else:
			self.status = 'You must be loged in in order to use the Accounting Service'
			self.redirect(LoginHandler.get_url())