Beispiel #1
0
 def get(self):
   user = users.get_current_user()
   logout_url = users.create_logout_url(self.request.uri)
   login_url = users.create_login_url(self.request.uri)
   if user:
     resume_orgs = ResumeOrganizations.query().fetch()
     self.render_normal_json(resume_orgs)
   else:
     self.redirect(login_url)
Beispiel #2
0
 def get(self,urlString):
   user = users.get_current_user()
   logout_url = users.create_logout_url(self.request.uri)
   login_url = users.create_login_url(self.request.uri)
   if user:
     resume_key = ndb.Key(urlsafe=urlString)
     resume = resume_key.get()
     resumeorgs = ResumeOrganizations.query(ancestor = resume_key).fetch()
     values = {
       'resumeorgs' : resumeorgs,
       'resume' : resume,
       'logout_url' : logout_url,
       'user' : user,
     }
     self.render_html('resume-detail.html',values)
   else:
     self.redirect(login_url)
Beispiel #3
0
 def post(self):
   user = users.get_current_user()
   logout_url = users.create_logout_url(self.request.uri)
   login_url = users.create_login_url(self.request.uri)
   if user: 
     resume_key = ndb.Key(urlsafe = self.request.get('resume_urlString'))
     resume_org = ResumeOrganizations(parent = resume_key)
     resume_org.name = self.request.get('name')
     resume_org.title = self.request.get('title')
     resume_org.startDate = self.request.get('startDate')
     resume_org.endDate = self.request.get('endDate')
     resume_org.location = self.request.get('location')
     resume_org.department = self.request.get('department')
     resume_org.primary = True if self.request.get('primary') == "true" else False
     resume_org.type = self.request.get('type')
     resume_org.description = self.request.get('description')
     resume_org.put()
   else:
     self.redirect(login_url)