Esempio n. 1
0
 def POST(self, name):
     authen = gc('name')
     if authen:
         article = Article.get(name)
         article.delete()
         return js(dict(r=True, id=name))
     return js(dict(r=False))
Esempio n. 2
0
 def POST(self, name):
     authen = gc('name')
     if authen:
         article = Article.get(name)
         article.delete()
         return js(dict(r=True, id=name))
     return js(dict(r=False))
Esempio n. 3
0
 def POST(self):
     req = gd()
     name = gc('name')
     if name:
         user = get_user(name)
         ok = add(req.cate, req.title, req.url, req.content, user.name)
         return js(dict(r = True, ok = ok))
     else:
         return js(dict(r = False))
Esempio n. 4
0
 def POST(self):
     req = gd()
     name = gc("name")
     if name:
         user = get_user(name)
         ok = add(req.cate, req.title, req.url, req.content, user.name)
         return js(dict(r=True, ok=ok))
     else:
         return js(dict(r=False))
Esempio n. 5
0
 def POST(self, id):
     article = Article.get(id)
     cate = article.cate
     req = gd()
     article.title = req.title
     article.cate = req.cate
     article.url = req.url
     article.content = req.content
     article.update(cate)
     return js(dict(r=True, ok=True, id=id))
Esempio n. 6
0
 def POST(self, id):
     article = Article.get(id)
     cate = article.cate
     req = gd()
     article.title = req.title
     article.cate = req.cate
     article.url = req.url
     article.content = req.content
     article.update(cate)
     return js(dict(r=True, ok=True, id=id))
Esempio n. 7
0
 def POST(self):
     req = gd()
     authen = authen_user(req.name, req.pwd)
     if authen:
         sc('name', req.name)
     return js(dict(r=True, authen=authen))
Esempio n. 8
0
 def POST(self):
     req = gd()
     authen = authen_user(req.name, req.pwd)
     if authen:
         sc('name', req.name)
     return js(dict(r=True, authen=authen))