Esempio n. 1
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() 
Esempio n. 2
0
def get_index(req):
  user = users.get_current_user()
  if not user:
      return req.redirect(users.create_login_url(req.uri.application_uri()))
  t = Template(req,'index.html',TEMPLATE_PATH)
  upload_url = blobstore.create_upload_url('/formupload/'+user.user_id())
  t.assign('upload_url',upload_url)
  query = Item.all()
  query.order("-created")
  items = query.fetch(1000)
  t.assign('items',items)
  t.assign('title','SimpleRepository: Items') 
  req.res.body = t.fetch() 
Esempio n. 3
0
def get_dropbox(req):
  user = users.get_current_user()
  if not user:
      return req.redirect(users.create_login_url(req.uri.application_uri()))
  t = Template(req,'dropbox.html',TEMPLATE_PATH)
  t.assign('title','SimpleRepository: Dropbox') 
  t.assign('dropbox_items',Dropbox.get_list_by_user(user))
  req.res.body = t.fetch() 
Esempio n. 4
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() 
Esempio n. 5
0
def get_item(req):
  user = users.get_current_user()
  if not user:
      return req.redirect(users.create_login_url(req.uri.application_uri()))
  t = Template(req,'item.html',TEMPLATE_PATH)
  id = int(req.get('id'))
  item = Item.get_by_id(id) 
  t.assign('item',item)
  t.assign('title','SimpleRepository: Item '+str(id)) 
  req.res.body = t.fetch()