def get(self, direction, displayOrderToMove):
     displayOrderToMove = int(displayOrderToMove)
     # I am assuming displayOrder has no duplicates
     FirstObject = StudentOfficer.gql("WHERE DisplayOrder = :1", displayOrderToMove).get()
     if direction == 'u':
         SecondObject = StudentOfficer.gql("WHERE DisplayOrder < :1 ORDER BY DisplayOrder DESC",
                                           displayOrderToMove).get()
     else:
         SecondObject = StudentOfficer.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/student_officers')
 def get(self, direction, displayOrderToMove):
     displayOrderToMove = int(displayOrderToMove)
     # I am assuming displayOrder has no duplicates
     FirstObject = StudentOfficer.gql("WHERE DisplayOrder = :1", displayOrderToMove).get()
     if direction == 'u':
         SecondObject = StudentOfficer.gql("WHERE DisplayOrder < :1 ORDER BY DisplayOrder DESC",
                                           displayOrderToMove).get()
     else:
         SecondObject = StudentOfficer.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/student_officers')
        def post_process_model(filled_student_officer):
            filled_student_officer.Image = images.resize(filled_student_officer.Image, 100, 196)

            if not filled_student_officer.DisplayOrder:
                # TODO: only get DisplayOrder
                # displayOrderObject = GqlQuery("SELECT DisplayOrder FROM StudentOfficer ORDER BY DisplayOrder DESC").get()
                displayOrderObject = StudentOfficer.gql("ORDER BY DisplayOrder DESC").get()
                if displayOrderObject and displayOrderObject.DisplayOrder:
                    filled_student_officer.DisplayOrder = displayOrderObject.DisplayOrder + 1
                else:
                    filled_student_officer.DisplayOrder = 1
        def post_process_model(filled_student_officer):
            filled_student_officer.Image = images.resize(filled_student_officer.Image, 100, 196)

            if not filled_student_officer.DisplayOrder:
                # TODO: only get DisplayOrder
                # displayOrderObject = GqlQuery("SELECT DisplayOrder FROM StudentOfficer ORDER BY DisplayOrder DESC").get()
                displayOrderObject = StudentOfficer.gql("ORDER BY DisplayOrder DESC").get()
                if displayOrderObject and displayOrderObject.DisplayOrder:
                    filled_student_officer.DisplayOrder = displayOrderObject.DisplayOrder + 1
                else:
                    filled_student_officer.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['existingStudentOfficers'] = StudentOfficer.gql("ORDER BY DisplayOrder ASC").fetch(50)
        self.template_vars['form'] = self.generate_form(StudentOfficer_Form)

        self.render_template("manage/student_officers/student_officers.html")
Esempio n. 7
0
 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.generate_manage_bar()
        self.template_vars['existingStudentOfficers'] = StudentOfficer.gql("ORDER BY DisplayOrder ASC").fetch(50)
        self.template_vars['form'] = self.generate_form(StudentOfficer_Form)

        self.render_template("manage/student_officers/student_officers.html")
Esempio n. 9
0
 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")