def get(self, direction, displayOrderToMove): displayOrderToMove = int(displayOrderToMove) # I am assuming displayOrder has no duplicates FirstObject = StaffPosition.gql("WHERE DisplayOrder = :1", displayOrderToMove).get() if direction == 'u': SecondObject = StaffPosition.gql("WHERE DisplayOrder < :1 ORDER BY DisplayOrder DESC", displayOrderToMove).get() else: SecondObject = StaffPosition.gql("WHERE DisplayOrder > :1 ORDER BY DisplayOrder ASC", displayOrderToMove).get() FirstObject.DisplayOrder, SecondObject.DisplayOrder = SecondObject.DisplayOrder, FirstObject.DisplayOrder FirstObject.put() SecondObject.put() self.redirect('/manage/staff_positions')
def get(self): self.generate_manage_bar() self.template_vars['existingStaffPositions'] = StaffPosition.gql( "ORDER BY DisplayOrder ASC").fetch(50) self.template_vars['form'] = self.generate_form(StaffPosition_Form) self.render_template("manage/staff_positions/staff_positions.html")
def get(self, direction, displayOrderToMove): displayOrderToMove = int(displayOrderToMove) # I am assuming displayOrder has no duplicates FirstObject = StaffPosition.gql("WHERE DisplayOrder = :1", displayOrderToMove).get() if direction == 'u': SecondObject = StaffPosition.gql( "WHERE DisplayOrder < :1 ORDER BY DisplayOrder DESC", displayOrderToMove).get() else: SecondObject = StaffPosition.gql( "WHERE DisplayOrder > :1 ORDER BY DisplayOrder ASC", displayOrderToMove).get() FirstObject.DisplayOrder, SecondObject.DisplayOrder = SecondObject.DisplayOrder, FirstObject.DisplayOrder FirstObject.put() SecondObject.put() self.redirect('/manage/staff_positions')
def post_process_model(filled_staff_position): filled_staff_position.Image = images.resize(filled_staff_position.Image, 147, 123) if not filled_staff_position.DisplayOrder: # TODO: only get DisplayOrder # displayOrderObject = GqlQuery("SELECT DisplayOrder FROM StudentOfficer ORDER BY DisplayOrder DESC").get() displayOrderObject = StaffPosition.gql("ORDER BY DisplayOrder DESC").get() if displayOrderObject and displayOrderObject.DisplayOrder: filled_staff_position.DisplayOrder = displayOrderObject.DisplayOrder + 1 else: filled_staff_position.DisplayOrder = 1
def post_process_model(filled_staff_position): filled_staff_position.Image = images.resize( filled_staff_position.Image, 147, 123) if not filled_staff_position.DisplayOrder: # TODO: only get DisplayOrder # displayOrderObject = GqlQuery("SELECT DisplayOrder FROM StudentOfficer ORDER BY DisplayOrder DESC").get() displayOrderObject = StaffPosition.gql( "ORDER BY DisplayOrder DESC").get() if displayOrderObject and displayOrderObject.DisplayOrder: filled_staff_position.DisplayOrder = displayOrderObject.DisplayOrder + 1 else: filled_staff_position.DisplayOrder = 1
def get(self): self.generate_manage_bar() self.template_vars['existingStaffPositions'] = StaffPosition.gql("ORDER BY DisplayOrder ASC").fetch(50) self.template_vars['staff_form'] = self.generate_form(StaffPosition_Form) self.template_vars['staff_form'].Type.data = "Staff" self.template_vars['existingStudentOfficers'] = StudentOfficer.gql("ORDER BY DisplayOrder ASC").fetch(50) self.template_vars['officer_form'] = self.generate_form(StudentOfficer_Form) self.template_vars['officer_form'].Type.data = "Officer" self.template_vars['existingBoardMembers'] = BoardMember.gql("ORDER BY DisplayOrder ASC").fetch(50) self.template_vars['board_member_form'] = self.generate_form(BoardMember_Form) self.template_vars['board_member_form'].Type.data = "Board" self.render_template("manage/staff_positions/staff_positions.html")
def get(self): self.generate_manage_bar() self.template_vars['existingStaffPositions'] = StaffPosition.gql("ORDER BY DisplayOrder ASC").fetch(50) self.template_vars['form'] = self.generate_form(StaffPosition_Form) self.render_template("manage/staff_positions/staff_positions.html")
def get(self): self.template_vars['StaffPositions'] = StaffPosition.gql( "ORDER BY DisplayOrder ASC") self.template_vars['studentOfficers'] = StudentOfficer.gql( "ORDER BY DisplayOrder ASC").fetch(50) self.render_template("aboutus/staff.html")
def get(self): self.template_vars['StaffPositions'] = StaffPosition.gql("ORDER BY DisplayOrder ASC") self.template_vars['studentOfficers'] = StudentOfficer.gql("ORDER BY DisplayOrder ASC").fetch(50) self.render_template("aboutus/staff.html")