示例#1
0
def delete_attribute(req):
  user = users.get_current_user()
  if not user:
      return req.redirect(users.create_login_url(req.uri.application_uri()))
  ascii_id = req.get('ascii_id')
  query = Attribute.all()
  query.filter('ascii_id =',ascii_id)
  att = query.fetch(1)[0]
  #full delete???
  att.delete()
示例#2
0
def get_attributes(req):
  user = users.get_current_user()
  if not user:
      return req.redirect(users.create_login_url(req.uri.application_uri()))
  t = Template(req,'attributes.html',TEMPLATE_PATH)
  query = Attribute.all()
  atts = query.fetch(1000)
  t.assign('attributes',atts)
  t.assign('title','SimpleRepository: Attributes') 
  req.res.body = t.fetch() 
示例#3
0
def get_attribute(req):
  user = users.get_current_user()
  if not user:
      return req.redirect(users.create_login_url(req.uri.application_uri()))
  t = Template(req,'attribute.html',TEMPLATE_PATH)
  ascii_id = req.get('ascii_id')
  query = Attribute.all()
  query.filter('ascii_id =',ascii_id)
  att = query.fetch(1)[0]
  t.assign('att',att)
  req.res.body = t.fetch()