Esempio n. 1
0
	def post(self): #logout
		accountid = self.session.get('accountid')
		account_ = Account.get_by_accountid(accountid)
		towhom_ = None
		try:
			towhom_ = Account.get_by_accountid(int(towhomID))
		except:
			towhom_ = None
		params = {}
		params['dataID'] = self.request.get('dataID')
		params['cost'] = self.request.get('cost')
		params['receipt_type'] = self.request.get('receipt_type')

		Receipt.new(params,account_,towhom_)
		self.redirect('/'+accountid+'/')
Esempio n. 2
0
    def post(self):  #logout
        accountid = self.session.get('accountid')
        account_ = Account.get_by_accountid(accountid)
        towhom_ = None
        try:
            towhom_ = Account.get_by_accountid(int(towhomID))
        except:
            towhom_ = None
        params = {}
        params['dataID'] = self.request.get('dataID')
        params['cost'] = self.request.get('cost')
        params['receipt_type'] = self.request.get('receipt_type')

        Receipt.new(params, account_, towhom_)
        self.redirect('/' + accountid + '/')
Esempio n. 3
0
	def get(self):
		accountid = self.session.get('accountid')
		account = Account.get_by_accountid(accountid)
		if 1 != account.mod:
			return
		mode = self.request.get('mode')
		keytodel = self.request.get('del')
		if 'all' == mode:
			pages = Page.all().order('-created')
		else:
			pages = Page.all().order('-created').fetch(limit=5)
		pagelist = []
		Next = namedtuple("Next", "pageid contentid")
		for page in pages:
			page.keyname = str(page.key().id())
			if page.contents.count() > 0: #content at foremost 
				page.content = page.contents[0].content
				page.content.keyid = page.content.key().id()
			childlist = []
			for l in page.childs:
				if l.child_page.contents.count() > 0:
					n = Next(l.child_page.key().id(), l.child_page.contents[0].content.key().id())
					childlist.append(n)
			page.childlist = childlist
			pagelist.append(page)
		context = {'static_path': STATIC_PATH,
			'APP_TITLE' : APP_TITLE,
			'pages':pagelist,
			'keytodel':keytodel,
			'size':len(pagelist)}
		self.render_to_response('page_index.html',context)
Esempio n. 4
0
    def get(self):
        result = self.request.get('result')
        accountid = self.session.get('accountid')
        account = Account.get_by_accountid(accountid)
        if 1 != account.mod:
            return
        f_data = {'testcode': '{"id":"5","lang":"ko","tostudy":"en"}'}
        s_form = APIForm(f_data)

        cinput = "/app/content/%d?lang=%s&tostudy=%s"
        coutput = """success={success=True,
		id=%s(key_id),index=%d,version=%d,visible=%d,
		expiration_date=%d,
		lang=%s,name=%s,description=%s,
		price=%d,
		part=%s,
		tran={
			lang=%s,name=%s,description=%s,
		},
		}
		error={success=False,error='the reason of error',
		id=%s(key_id),
		}
		"""
        context = {
            'static_path': STATIC_PATH,
            'input': cinput,
            'output': coutput,
            'result': result,
            'form': s_form
        }
        self.render_to_response('apitest_index.html', context)
Esempio n. 5
0
 def get(self):
     accountid = self.session.get('accountid')
     account = Account.get_by_accountid(accountid)
     if 1 != account.mod:
         return
     mode = self.request.get('mode')
     keytodel = self.request.get('del')
     if 'all' == mode:
         pages = Page.all().order('-created')
     else:
         pages = Page.all().order('-created').fetch(limit=5)
     pagelist = []
     Next = namedtuple("Next", "pageid contentid")
     for page in pages:
         page.keyname = str(page.key().id())
         if page.contents.count() > 0:  #content at foremost
             page.content = page.contents[0].content
             page.content.keyid = page.content.key().id()
         childlist = []
         for l in page.childs:
             if l.child_page.contents.count() > 0:
                 n = Next(l.child_page.key().id(),
                          l.child_page.contents[0].content.key().id())
                 childlist.append(n)
         page.childlist = childlist
         pagelist.append(page)
     context = {
         'static_path': STATIC_PATH,
         'APP_TITLE': APP_TITLE,
         'pages': pagelist,
         'keytodel': keytodel,
         'size': len(pagelist)
     }
     self.render_to_response('page_index.html', context)
Esempio n. 6
0
	def get(self):
		result = self.request.get('result')
		accountid = self.session.get('accountid')
		account = Account.get_by_accountid(accountid)
		if 1 != account.mod:
			return
		f_data = {
			'testcode':
			'{"id":"5","lang":"ko","tostudy":"en"}'
		}
		s_form = APIForm(f_data)

		cinput = "/app/content/%d?lang=%s&tostudy=%s"
		coutput = """success={success=True,
		id=%s(key_id),index=%d,version=%d,visible=%d,
		expiration_date=%d,
		lang=%s,name=%s,description=%s,
		price=%d,
		part=%s,
		tran={
			lang=%s,name=%s,description=%s,
		},
		}
		error={success=False,error='the reason of error',
		id=%s(key_id),
		}
		"""
		context = {'static_path': STATIC_PATH,
			'input':cinput,
			'output':coutput,
			'result':result,
			'form':s_form}
		self.render_to_response('apitest_index.html',context)
Esempio n. 7
0
    def post(self, pageid):
        accountid = self.session.get('accountid')
        account = Account.get_by_accountid(accountid)
        if 1 != account.mod:
            return

        contentlist = []
        contentid = self.request.get('contentid')
        nameen = self.request.get('nameen')
        nameko = self.request.get('nameko')

        if "" != contentid:
            i = Content.get_by_id(int(contentid))
            i.keyid = i.key().id()
            contentlist.append(i)
        elif "" != nameen:
            result = Content.all().filter("nameen =", nameen)
            for i in result:
                i.keyid = i.key().id()
                contentlist.append(i)
        elif "" != nameko:
            result = Content.all().filter("nameko =", nameko)
            for i in result:
                i.keyid = i.key().id()
                contentlist.append(i)

        context = {
            'static_path': STATIC_PATH,
            'APP_TITLE': APP_TITLE,
            'contents': contentlist,
            'pageid': pageid,
        }
        self.render_to_response('page_content_search.html', context)
Esempio n. 8
0
 def get(self):
     accountid = self.session.get('accountid')
     account = Account.get_by_accountid(accountid)
     if 1 != account.mod:
         return
     mode = self.request.get('mode')
     keytodel = self.request.get('del')
     contents = None
     if 'all' == mode:
         contents = Content.all().order('-created')
     elif 'less' == mode:
         contents = Content.all().order('-created').fetch(limit=5)
     else:
         contents = []
     contentlist = []
     for content in contents:
         content.keyid = str(content.key().id())
         contentlist.append(content)
     context = {
         'static_path': STATIC_PATH,
         'APP_TITLE': APP_TITLE,
         'size': len(contentlist),
         'keytodel': keytodel,
         'contents': contentlist
     }
     self.render_to_response('content_index.html', context)
Esempio n. 9
0
	def get(self):
		result = self.request.get('result')
		accountid = self.session.get('accountid')
		account = Account.get_by_accountid(accountid)
		if 1 != account.mod:
			return
		f_data = {
			'testcode':
			'{"id":"4","lang":"ko"}'
		}
		s_form = APIForm(f_data)

		cinput = "/app/story/%d?lang=%s"
		coutput = """success={success=True,
		id=%s(key_id),index=%d,version=%d,visible=%d,
		expiration_date=%d,
		lang=%s,name=%s,description=%s,
		price=%d,main_categoryid=%s(key_name),
		pages=[%d(key_id),%d,%d,%d],
		purchased=True/False,
		}
		error={success=False,error='the reason of error',
		id=%s(key_id),
		}
		"""
		context = {'static_path': STATIC_PATH,
			'input':cinput,
			'output':coutput,
			'result':result,
			'form':s_form}
		self.render_to_response('apitest_index.html',context)
Esempio n. 10
0
	def post(self,pageid):
		accountid = self.session.get('accountid')
		account = Account.get_by_accountid(accountid)
		if 1 != account.mod:
			return

		contentlist = []
		contentid = self.request.get('contentid')
		nameen = self.request.get('nameen')
		nameko = self.request.get('nameko')

		if "" != contentid:
			i = Content.get_by_id(int(contentid))
			i.keyid = i.key().id()
			contentlist.append(i)
		elif "" != nameen:
			result = Content.all().filter("nameen =",nameen)
			for i in result :
				i.keyid = i.key().id()
				contentlist.append(i)
		elif "" != nameko:
			result = Content.all().filter("nameko =",nameko)
			for i in result :
				i.keyid = i.key().id()
				contentlist.append(i)

		context = {'static_path': STATIC_PATH,
			'APP_TITLE' : APP_TITLE,
			'contents':contentlist,
			'pageid':pageid,
		}
		self.render_to_response('page_content_search.html',context)
Esempio n. 11
0
    def get(self):
        accountid = self.session.get('accountid')
        account = Account.get_by_accountid(accountid)
        if 1 != account.mod:
            return

        result = self.request.get('result')
        f_data = {
            'testcode':
            '{"facebookid":"1232","access_token":"assdf","name":"myname"}'
        }
        s_form = APIForm(f_data)
        cinput = "/app/account/login?facebookid=%s&access_token=%s&name=%s"
        coutput = """[
			id=%s
			success=True/False
			created=True/False
		]"""
        context = {
            'static_path': STATIC_PATH,
            'input': cinput,
            'output': coutput,
            'result': result,
            'form': s_form
        }
        self.render_to_response('apitest_index.html', context)
Esempio n. 12
0
 def get(self):
     accountid = self.session.get('accountid')
     account = Account.get_by_accountid(accountid)
     if 1 != account.mod:
         return
     if None is accountid:
         context = {
             'static_path': STATIC_PATH,
             'APP_TITLE': APP_TITLE,
             'err_msg': "You should login"
         }
         self.render_to_response('err_page.html', context)
         return
     keytodel = self.request.get('del')
     stories = Story.all()
     stories.order('-created')
     storylist = []
     for story in stories:
         story.keyname = str(story.key().id())
         storylist.append(story)
     storysortedlist = sorted(storylist, key=lambda p: p.index)
     context = {
         'static_path': STATIC_PATH,
         'APP_TITLE': APP_TITLE,
         'stories': storysortedlist,
         'keytodel': keytodel,
         'size': len(storylist)
     }
     self.render_to_response('story_index.html', context)
Esempio n. 13
0
    def get(self):
        result = self.request.get('result')
        accountid = self.session.get('accountid')
        account = Account.get_by_accountid(accountid)
        if 1 != account.mod:
            return
        f_data = {'testcode': '{"id":"4","lang":"ko"}'}
        s_form = APIForm(f_data)

        cinput = "/app/story/%d?lang=%s"
        coutput = """success={success=True,
		id=%s(key_id),index=%d,version=%d,visible=%d,
		expiration_date=%d,
		lang=%s,name=%s,description=%s,
		price=%d,main_categoryid=%s(key_name),
		pages=[%d(key_id),%d,%d,%d],
		purchased=True/False,
		}
		error={success=False,error='the reason of error',
		id=%s(key_id),
		}
		"""
        context = {
            'static_path': STATIC_PATH,
            'input': cinput,
            'output': coutput,
            'result': result,
            'form': s_form
        }
        self.render_to_response('apitest_index.html', context)
Esempio n. 14
0
	def get(self):
		accountid = self.session.get('accountid')
		account = Account.get_by_accountid(accountid)
		if 1 != account.mod:
			return
		if None is accountid:
			context = {'static_path': STATIC_PATH,
			'APP_TITLE' : APP_TITLE,
			'err_msg':"You should login"}
			self.render_to_response('err_page.html',context)
			return
		keytodel = self.request.get('del')
		stories = Story.all()
		stories.order('-created')
		storylist = []
		for story in stories:
			story.keyname = str(story.key().id())
			storylist.append(story)
		storysortedlist = sorted(storylist, key=lambda p: p.index)
		context = {'static_path': STATIC_PATH,
			'APP_TITLE' : APP_TITLE,
			'stories':storysortedlist,
			'keytodel':keytodel,
			'size':len(storylist)}
		self.render_to_response('story_index.html',context)
Esempio n. 15
0
 def get(self, contentid):
     accountid = self.session.get('accountid')
     account = Account.get_by_accountid(accountid)
     if 1 != account.mod:
         return
     content = Content.get_by_id(int(contentid))
     content.delete()
     self.redirect('/content')
Esempio n. 16
0
	def get(self,contentid):
		accountid = self.session.get('accountid')
		account = Account.get_by_accountid(accountid)
		if 1 != account.mod:
			return
		content = Content.get_by_id(int(contentid))
		content.delete()
		self.redirect('/content')
Esempio n. 17
0
 def post(self):
     accountid = self.session.get('accountid')
     account = Account.get_by_accountid(accountid)
     testcode = self.request.get('testcode')
     assert (testcode)
     d = json.loads(testcode)
     assert (d)
     det = Account.api_gift(d['coin'], d['candy'], account)
     self.redirect(self.request.url + 'input?result=' + str(det))
Esempio n. 18
0
	def post(self):
		accountid = self.session.get('accountid')
		account = Account.get_by_accountid(accountid)
		testcode = self.request.get('testcode')
		assert(testcode)
		d = json.loads(testcode)
		assert(d)
		det = Account.api_gift(d['coin'],d['candy'],account)
		self.redirect(self.request.url + 'input?result='+str(det))
Esempio n. 19
0
    def get(self):
        accountid = self.session.get('accountid')
        account = Account.get_by_accountid(accountid)
        if 1 != account.mod:
            return

        s_form = ReceiptInfoForm(None)
        context = {'static_path': STATIC_PATH, 'form': s_form}
        self.render_to_response('form.html', context)
Esempio n. 20
0
 def get(self, storyid, pageid):
     accountid = self.session.get('accountid')
     account = Account.get_by_accountid(accountid)
     if 1 != account.mod:
         return
     page = Page.get_by_id(int(pageid))
     for link in page.contents:
         link.delete()
     page.delete()
     self.redirect("/story/" + storyid)
Esempio n. 21
0
 def post(self, keyid):  #logout
     accountid = self.session.get('accountid')
     account = Account.get_by_accountid(accountid)
     story_ = Story.get_by_id(int(keyid))
     page = Page.new(account, story_)
     pageid = int(self.request.get('pageid'))
     pageToImport = Page.get_by_id(int(pageid))
     for link in pageToImport.contents:
         PageContentLink.new(page, link.content)
     self.redirect('/story/' + keyid)
Esempio n. 22
0
	def post(self,keyid): #logout
		accountid = self.session.get('accountid')
		account = Account.get_by_accountid(accountid)
		story_ = Story.get_by_id(int(keyid))
		page = Page.new(account,story_)
		pageid = int(self.request.get('pageid'))
		pageToImport = Page.get_by_id(int(pageid))
		for link in pageToImport.contents:
			PageContentLink.new(page,link.content)
		self.redirect('/story/'+keyid)
Esempio n. 23
0
	def get(self):
		accountid = self.session.get('accountid')
		account = Account.get_by_accountid(accountid)
		if 1 != account.mod:
			return

		s_form = ReceiptInfoForm(None)
		context = {'static_path': STATIC_PATH,
			'form':s_form}
		self.render_to_response('form.html',context)
Esempio n. 24
0
 def get(self, categoryid):
     accountid = self.session.get('accountid')
     account = Account.get_by_accountid(accountid)
     if 1 != account.mod:
         return
     lang = self.request.get('lang')
     category = Category.getter(categoryid)
     category.support_tostudy_del(lang)
     category.put()
     self.redirect('/category/' + categoryid)
Esempio n. 25
0
	def get(self,storyid,pageid):
		accountid = self.session.get('accountid')
		account = Account.get_by_accountid(accountid)
		if 1 != account.mod:
			return
		page = Page.get_by_id(int(pageid))
		for link in page.contents:
			link.delete()
		page.delete()
		self.redirect("/story/"+storyid)
Esempio n. 26
0
	def get(self,categoryid):
		accountid = self.session.get('accountid')
		account = Account.get_by_accountid(accountid)
		if 1 != account.mod:
			return
		lang = self.request.get('lang')
		category = Category.getter(categoryid)
		category.support_tostudy_del(lang)
		category.put()
		self.redirect('/category/'+categoryid)
Esempio n. 27
0
    def get(self, pageid, contentid):
        accountid = self.session.get('accountid')
        account = Account.get_by_accountid(accountid)
        if 1 != account.mod:
            return

        page = Page.get_by_id(int(pageid))
        content = Content.get_by_id(int(contentid))
        PageContentLink.new(page, content)
        self.redirect('/page/' + pageid)
Esempio n. 28
0
	def get(self,pageid):
		accountid = self.session.get('accountid')
		account = Account.get_by_accountid(accountid)
		if 1 != account.mod:
			return
		s_form = PageContentsSyncForm(None)
		context = {'static_path': STATIC_PATH,
			'APP_TITLE' : APP_TITLE,
			'form':s_form}
		self.render_to_response('form.html',context)
Esempio n. 29
0
 def post(self):
     testcode = self.request.get('testcode')
     accountid = self.session.get('accountid')
     account = Account.get_by_accountid(accountid)
     if 1 != account.mod:
         return
     d = json.loads(testcode)
     assert (d)
     det = Story.api_purchase(d['id'], accountid)
     self.redirect(self.request.url + 'input?result=' + str(det))
Esempio n. 30
0
	def post(self):
		testcode = self.request.get('testcode')
		accountid = self.session.get('accountid')
		account = Account.get_by_accountid(accountid)
		if 1 != account.mod:
			return
		d = json.loads(testcode)
		assert(d)
		det = Story.api_purchase(d['id'],accountid)
		self.redirect(self.request.url + 'input?result='+str(det))
Esempio n. 31
0
	def get(self,pageid,contentid):
		accountid = self.session.get('accountid')
		account = Account.get_by_accountid(accountid)
		if 1 != account.mod:
			return

		page = Page.get_by_id(int(pageid))
		content = Content.get_by_id(int(contentid))
		PageContentLink.new(page,content)
		self.redirect('/page/'+pageid)
Esempio n. 32
0
 def post(self):  #logout
     accountid = self.session.get('accountid')
     account = Account.get_by_accountid(accountid)
     if 1 != account.mod:
         return
     page = Page.new(account)
     params = {}
     for key in self.request.arguments():
         params[key] = self.request.get(key)
     page.setter(params)
     self.redirect('/page')
Esempio n. 33
0
	def post(self,contentid): #logout
		accountid = self.session.get('accountid')
		account = Account.get_by_accountid(accountid)
		if 1 != account.mod:
			return
		content = Content.get_by_id(int(contentid))
		params = {}
		for key in self.request.arguments():
			params[key] = self.request.get(key)
		content.setter(params)
		self.redirect('/content')
Esempio n. 34
0
    def post(self, pageid1):
        accountid = self.session.get('accountid')
        account = Account.get_by_accountid(accountid)
        if 1 != account.mod:
            return

        pageid2 = self.request.get('pageid')
        page1 = Page.get_by_id(int(pageid1))
        page2 = Page.get_by_id(int(pageid2))
        PagePageLink.new(page1, page2)
        self.redirect('/page/' + pageid1)
Esempio n. 35
0
	def post(self,keyid): #logout
		accountid = self.session.get('accountid')
		account = Account.get_by_accountid(accountid)
		if 1 != account.mod:
			return
		story = Story.get_by_id(int(keyid))
		params = {}
		for key in self.request.arguments():
			params[key] = self.request.get(key)
		story.setter(params)
		self.redirect('/story/'+keyid)
Esempio n. 36
0
	def get(self,storyid):
		accountid = self.session.get('accountid')
		account = Account.get_by_accountid(accountid)
		if 1 != account.mod:
			return
		story_ = Story.get_by_id(int(storyid))
		pagelist = []
		for page in story_.pages:
			pagelist.append(page)
		Page.new(account,story_,len(pagelist)+1)
		self.redirect("/story/"+storyid)
Esempio n. 37
0
	def post(self):
		accountid = self.session.get('accountid')
		account = Account.get_by_accountid(accountid)
		if 1 != account.mod:
			return

		testcode = self.request.get('testcode')
		d = json.loads(testcode)
		assert(d)
		det = Page.api_read(d['id'],d['lang'])
		self.redirect(self.request.url + 'input?result='+str(det))
Esempio n. 38
0
	def get(self,storyid):
		accountid = self.session.get('accountid')
		account = Account.get_by_accountid(accountid)
		if 1 != account.mod:
			return
		lang = self.request.get('lang')
		story = Story.get_by_id(int(storyid))
		index = story.language.index(lang)
		del story.language[index]
		story.put()
		self.redirect("/story/"+storyid)
Esempio n. 39
0
 def get(self, storyid):
     accountid = self.session.get('accountid')
     account = Account.get_by_accountid(accountid)
     if 1 != account.mod:
         return
     story_ = Story.get_by_id(int(storyid))
     pagelist = []
     for page in story_.pages:
         pagelist.append(page)
     Page.new(account, story_, len(pagelist) + 1)
     self.redirect("/story/" + storyid)
Esempio n. 40
0
	def post(self,accountid):
		logging.info('asdfdszzzf')
		account = Account.get_by_accountid(accountid)
		logging.info('asdfdsf')
#		if 1 != account.mod:
#			return
		params = {}
		for key in self.request.arguments():
			params[key] = self.request.get(key)
		account.setter(params)
		self.redirect('/account')
Esempio n. 41
0
	def get(self,accountid):
		account = Account.get_by_accountid(accountid)
		logging.info('get')
		if 1 != account.mod:
			return
		f_data = account.to_formdict()
		s_form = AccountInfoForm(f_data)
		context = {'static_path': STATIC_PATH,
			'APP_TITLE' : APP_TITLE,
			'form':s_form}
		self.render_to_response('form.html',context)
Esempio n. 42
0
 def post(self, keyid):  #logout
     accountid = self.session.get('accountid')
     account = Account.get_by_accountid(accountid)
     if 1 != account.mod:
         return
     story = Story.get_by_id(int(keyid))
     params = {}
     for key in self.request.arguments():
         params[key] = self.request.get(key)
     story.setter(params)
     self.redirect('/story/' + keyid)
Esempio n. 43
0
 def get(self, storyid):
     accountid = self.session.get('accountid')
     account = Account.get_by_accountid(accountid)
     if 1 != account.mod:
         return
     lang = self.request.get('lang')
     story = Story.get_by_id(int(storyid))
     index = story.language.index(lang)
     del story.language[index]
     story.put()
     self.redirect("/story/" + storyid)
Esempio n. 44
0
    def post(self, category_name):
        accountid = self.session.get('accountid')
        account = Account.get_by_accountid(accountid)
        if 1 != account.mod:
            return

        storyid = self.request.get('storyid')
        category = Category.getter(category_name)
        story = Story.get_by_id(int(storyid))
        CategoryStoryLink.new(category, story)
        self.redirect('/category/' + category_name)
Esempio n. 45
0
	def post(self): #logout
		accountid = self.session.get('accountid')
		account = Account.get_by_accountid(accountid)
		if 1 != account.mod:
			return
		page = Page.new(account)
		params = {}
		for key in self.request.arguments():
			params[key] = self.request.get(key)
		page.setter(params)
		self.redirect('/page')
Esempio n. 46
0
    def get(self, key_name):
        accountid = self.session.get('accountid')
        account = Account.get_by_accountid(accountid)
        if 1 != account.mod:
            return

        category = Category.getter(key_name)
        for link in category.stories:
            link.delete()
        category.delete()
        self.redirect('/category')
Esempio n. 47
0
	def get(self,pageid):
		accountid = self.session.get('accountid')
		account = Account.get_by_accountid(accountid)
		if 1 != account.mod:
			return

		s_form = ContentInfoForm({'visible':1,'price':0,'index':0})
		context = {'static_path': STATIC_PATH,
			'APP_TITLE' : APP_TITLE,
			'form':s_form}
		self.render_to_response('form.html',context)
Esempio n. 48
0
 def post(self, contentid):  #logout
     accountid = self.session.get('accountid')
     account = Account.get_by_accountid(accountid)
     if 1 != account.mod:
         return
     content = Content.get_by_id(int(contentid))
     params = {}
     for key in self.request.arguments():
         params[key] = self.request.get(key)
     content.setter(params)
     self.redirect('/content')
Esempio n. 49
0
    def post(self):
        accountid = self.session.get('accountid')
        account = Account.get_by_accountid(accountid)
        if 1 != account.mod:
            return

        testcode = self.request.get('testcode')
        d = json.loads(testcode)
        assert (d)
        det = Page.api_read(d['id'], d['lang'])
        self.redirect(self.request.url + 'input?result=' + str(det))
Esempio n. 50
0
 def post(self, accountid):
     logging.info('asdfdszzzf')
     account = Account.get_by_accountid(accountid)
     logging.info('asdfdsf')
     #		if 1 != account.mod:
     #			return
     params = {}
     for key in self.request.arguments():
         params[key] = self.request.get(key)
     account.setter(params)
     self.redirect('/account')
Esempio n. 51
0
	def post(self,pageid1):
		accountid = self.session.get('accountid')
		account = Account.get_by_accountid(accountid)
		if 1 != account.mod:
			return

		pageid2 = self.request.get('pageid')
		page1 = Page.get_by_id(int(pageid1))
		page2 = Page.get_by_id(int(pageid2))
		PagePageLink.new(page1,page2)
		self.redirect('/page/'+pageid1)
Esempio n. 52
0
	def post(self,category_name): 
		accountid = self.session.get('accountid')
		account = Account.get_by_accountid(accountid)
		if 1 != account.mod:
			return

		storyid = self.request.get('storyid')
		category = Category.getter(category_name)
		story = Story.get_by_id(int(storyid))
		CategoryStoryLink.new(category,story)
		self.redirect('/category/'+category_name)
Esempio n. 53
0
	def get(self,keyid):
		accountid = self.session.get('accountid')
		account = Account.get_by_accountid(accountid)
		if 1 != account.mod:
			return

		receipt = Receipt.get_by_id(int(keyid))
		context = {'static_path': STATIC_PATH,
			'receipt':receipt,
			'keyid':receipt.key().id()}
		self.render_to_response('receipt_read.html',context)
Esempio n. 54
0
	def get(self,category_name):
		accountid = self.session.get('accountid')
		account = Account.get_by_accountid(accountid)
		if 1 != account.mod:
			return

		s_form = CategoryStoryAddForm(None)
		context = {'static_path': STATIC_PATH,
			'APP_TITLE' : APP_TITLE,
			'form':s_form}
		self.render_to_response('form.html',context)
Esempio n. 55
0
	def get(self,key_name):
		accountid = self.session.get('accountid')
		account = Account.get_by_accountid(accountid)
		if 1 != account.mod:
			return

		category = Category.getter(key_name)
		for link in category.stories:
			link.delete()
		category.delete()
		self.redirect('/category')
Esempio n. 56
0
    def post(self, pageid):
        accountid = self.session.get('accountid')
        account = Account.get_by_accountid(accountid)
        if 1 != account.mod:
            return

        page = Page.get_by_id(int(pageid))
        params = {}
        for key in self.request.arguments():
            params[key] = self.request.get(key)
        page.setter(params)
        self.redirect('/page/' + pageid)
Esempio n. 57
0
    def get(self, pageid, contentid):
        accountid = self.session.get('accountid')
        account = Account.get_by_accountid(accountid)
        if 1 != account.mod:
            return

        p = Page.get_by_id(int(pageid))
        c = Content.get_by_id(int(contentid))
        obj = PageContentLink.get_by_key_name(
            str(p.key().id()) + "+" + str(c.key().id()))
        obj.delete()
        self.redirect("/page/" + pageid)
Esempio n. 58
0
 def get(self, pageid):
     accountid = self.session.get('accountid')
     account = Account.get_by_accountid(accountid)
     if 1 != account.mod:
         return
     s_form = PageContentsSyncForm(None)
     context = {
         'static_path': STATIC_PATH,
         'APP_TITLE': APP_TITLE,
         'form': s_form
     }
     self.render_to_response('form.html', context)
Esempio n. 59
0
	def post(self,key_name):
		accountid = self.session.get('accountid')
		account = Account.get_by_accountid(accountid)
		if 1 != account.mod:
			return

		category = Category.getter(key_name)
		params = {}
		for key in self.request.arguments():
			params[key] = self.request.get(key)
		category.setter(params)
		self.redirect('/category')
Esempio n. 60
0
    def post(self, key_name):
        accountid = self.session.get('accountid')
        account = Account.get_by_accountid(accountid)
        if 1 != account.mod:
            return

        category = Category.getter(key_name)
        params = {}
        for key in self.request.arguments():
            params[key] = self.request.get(key)
        category.setter(params)
        self.redirect('/category')