当前位置: 首页>>代码示例>>Python>>正文


Python Student.query方法代码示例

本文整理汇总了Python中student.Student.query方法的典型用法代码示例。如果您正苦于以下问题:Python Student.query方法的具体用法?Python Student.query怎么用?Python Student.query使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在student.Student的用法示例。


在下文中一共展示了Student.query方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: get

# 需要导入模块: from student import Student [as 别名]
# 或者: from student.Student import query [as 别名]
    def get(self):
        user = users.get_current_user()
        q = Student.query(Student.email == user.email())
        p = q.get()

        settings_params = {"name": user.nickname(), "graduationProgress": 70}
        render_template(self, "settings.html", settings_params)
开发者ID:bwerner9328,项目名称:pitt-got,代码行数:9,代码来源:settings.py

示例2: get

# 需要导入模块: from student import Student [as 别名]
# 或者: from student.Student import query [as 别名]
 def get(self):
     query = Student.query().filter(Student.name == "Adina Wallis")
     student_list = query.fetch()
     for s in student_list:
         self.response.write('<p>%s</p>' % s.name)
         # s.birthday = '01/01/2000'
         # s.put()
         s.key.delete()
开发者ID:eileenrose,项目名称:eileenrose.github.io,代码行数:10,代码来源:main.py

示例3: post

# 需要导入模块: from student import Student [as 别名]
# 或者: from student.Student import query [as 别名]
 def post(self) :
   user = users.get_current_user()
   falseBoolList = [False] * 40
   q = Student.query(Student.email == user.email())
   p = q.get()
   p.major = self.request.get('Major')
   p.put()
   render_table(self, q)
   return self.redirect("/")
开发者ID:bwerner9328,项目名称:pitt-got,代码行数:11,代码来源:register.py

示例4: get

# 需要导入模块: from student import Student [as 别名]
# 或者: from student.Student import query [as 别名]
    def get(self) :
      user = users.get_current_user()
      q = Student.query(Student.email == user.email())
      p = q.get()
      cur_user = p

      gpa_params = {
      "name" : user.nickname(),
      "studgpa": cur_user.gpa,
      'graduationProgress': cur_user.gradProgress,
      'credTaken': cur_user.creditsTaken,
      }
      render_template(self, 'gpa.html', gpa_params)
开发者ID:bwerner9328,项目名称:pitt-got,代码行数:15,代码来源:gpa.py

示例5: post

# 需要导入模块: from student import Student [as 别名]
# 或者: from student.Student import query [as 别名]
 def post(self):
     user = users.get_current_user()
     falseBoolList = [False] * 40
     result = db.GqlQuery("SELECT * FROM Student WHERE email = :email", email=user.email())
     if result:
         for r in result:
             r.major = self.request.get("Major")
             r.classTaken = falseBoolList
             r.gpa = float(self.request.get("GPA"))
             r.creditsTaken = int(self.request.get("creditsTaken"))
             db.put(r)
         q = Student.query(Student.email == user.email())
         p = q.get()
         render_table(self, q)
开发者ID:bwerner9328,项目名称:pitt-got,代码行数:16,代码来源:settings.py

示例6: get

# 需要导入模块: from student import Student [as 别名]
# 或者: from student.Student import query [as 别名]
    def get(self) :
      user = users.get_current_user()
      q = Student.query(Student.email == user.email())
      p = q.get()
      
      if p.avatar:
        self.response.headers['Content-Type'] = 'image/png'
        self.response.out.write(p.avatar)
      else:
        self.response.out.write('No image')

      profile_params = {
      "name" : user.nickname(),
      'graduationProgress': cur_user.gradProgress,
      }
      render_template(self, 'profilepic.html', profile_params)
开发者ID:bwerner9328,项目名称:pitt-got,代码行数:18,代码来源:profile.py

示例7: get

# 需要导入模块: from student import Student [as 别名]
# 或者: from student.Student import query [as 别名]
    def get(self) :
      user = users.get_current_user()
      q = Student.query(Student.email == user.email())
      p = q.get()
      usermajor = p.major
      events = p.events

      i = 0;
      events_string = "events: ["

      for e in events:
        if i == 0:
          events_string = events_string +"{"
          i=i+1
        else:
          events_string = events_string +",{"
        events_string = events_string +"id: " +str(e.eventID)+","
        events_string = events_string +"title: '"+e.eventTitle+"',"
        if e.eventAllDay:
          events_string = events_string +"start: '"+ e.eventStart[:10]+"'"
        else:
          events_string = events_string +"start: '"+ e.eventStart+"',"
          events_string = events_string +"end: '"+ e.eventEnd+"'"
        events_string = events_string + "}"


      events_string = events_string + "]"
      now = datetime.datetime.now()
      date = now.strftime("%Y-%m-%d")
      eventList = []
      idList = []
      for e in events:
        if e.eventID not in idList:
          eventList.append(e.eventTitle +" (id: " + str(e.eventID)+")")
          idList.append(e.eventID)


      settings_params = {
      "name" : user.nickname(),
      'graduationProgress': 70,
      'events': events_string,
      'date': date,
      'eventList': eventList
      }
      render_template(self, 'agenda-views.html', settings_params)
开发者ID:bwerner9328,项目名称:pitt-got,代码行数:47,代码来源:schedule.py

示例8: post

# 需要导入模块: from student import Student [as 别名]
# 或者: from student.Student import query [as 别名]
    def post(self):
      req = self.request.arguments().pop()
      
      user = users.get_current_user()
      q = Student.query(Student.email == user.email())
      p = q.get()
      
      events = p.events
      logging.info(int(req))
      for i in xrange(len(p.events) -1, -1, -1):
        if p.events[i].eventID==int(req):
          del p.events[i]


      # event name
      

      p.put()
开发者ID:bwerner9328,项目名称:pitt-got,代码行数:20,代码来源:scheduleDelete.py

示例9: post

# 需要导入模块: from student import Student [as 别名]
# 或者: from student.Student import query [as 别名]
    def post(self):
      req = self.request.arguments().pop()
      allreq = req.split(",")
      user = users.get_current_user()
      q = Student.query(Student.email == user.email())
      p = q.get()
      
      usermajor = p.major
      events = p.events
      i = 0;
      if p.curid is None:
        p.curid = 0
        curid = 0
      else:
        curid = p.curid+1
        p.curid = p.curid+1
      # event name
      
      if(len(allreq[0]) > 0 & len(allreq[0]) < 30):
        # repeat
        if(allreq[2] == "true"):
          if(allreq[3] is not None):
            # allday
            while i < int(allreq[3]):
              if(allreq[1] is "true"):
                new_event = Events(eventTitle=allreq[0], eventAllDay=True, eventID=curid, eventStart=allreq[4]+"-"+allreq[5]+"-"+str((int(allreq[6])+i*7))+"T"+allreq[7]+":00:00", eventEnd=allreq[8]+"-"+allreq[9]+"-"+allreq[10]+"T"+allreq[11]+":00:00")
              else:
                new_event = Events(eventTitle=allreq[0], eventAllDay=False, eventID=curid, eventStart=allreq[4]+"-"+allreq[5]+"-"+str((int(allreq[6])+i*7))+"T"+allreq[7]+":00:00", eventEnd=allreq[8]+"-"+allreq[9]+"-"+allreq[10]+"T"+allreq[11]+":00:00")
              
              p.events.append(new_event)
              i=i+1
      p.put()

      i = 0;
      events_string = "events: ["
      events = p.events
      for e in events:
        if i == 0:
          events_string = events_string +"{"
          i=i+1
        else:
          events_string = events_string +",{"
        events_string = events_string +"id: " +str(e.eventID)+","
        events_string = events_string +"title: '"+e.eventTitle+"',"
        if e.eventAllDay:
          events_string = events_string +"start: '"+ e.eventStart[:10]+"'"
        else:
          events_string = events_string +"start: '"+ e.eventStart+"',"
          events_string = events_string +"end: '"+ e.eventEnd+"'"
        events_string = events_string + "}"


      events_string = events_string + "]"
      now = datetime.datetime.now()
      date = now.strftime("%Y-%m-%d")
      eventList = []
      idList = []
      for e in events:
        if e.eventID not in idList:
          eventList.append(e.eventTitle +" (id: " + str(e.eventID)+")")
          idList.append(e.eventID)


      settings_params = {
      "name" : user.nickname(),
      'graduationProgress': 70,
      'events': events_string,
      'date': date,
      'eventList': eventList
      }
      render_template(self, 'agenda-views.html', settings_params)
开发者ID:bwerner9328,项目名称:pitt-got,代码行数:73,代码来源:schedule.py


注:本文中的student.Student.query方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。