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


Python Course.id方法代码示例

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


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

示例1: get_course_class_list

# 需要导入模块: from course import Course [as 别名]
# 或者: from course.Course import id [as 别名]
    def get_course_class_list(self):        
        from algorithm.models import School, Department, Class, Prerequisite, Building, Room, Period, Lecturer, ClassInstance, ClassLab, Person, Role, PersonRole 
        from course_class import CourseClass
    # This section takes values from the database and stores them in course clas list 
        print "This will print out all of the course classes currently in the database"
        self.classes_list = []

        all_course_class = ClassInstance.objects.all()
        for ClassInstance in all_course_class:       

            lecturer = ClassInstance.idLecturer
            new_prof = Professor()
            new_prof.name = lecturer.Name
            new_prof.id = lecturer.idLecturer

            Class = ClassInstance.idClass
            new_course = Course()
            new_course.id = Class.idClass
            new_course.name = Class.Class
            
            
            


            new_course_class = CourseClass()
            new_course_class.professor = new_prof
            new_course_class.course = new_course
            new_course_class.duration = 1
            new_course_class.lab = False
            new_course_class.id = ClassInstance.idClassInstance
            self.classes_list.append(new_course_class)
            self.num_classes += 1

        for course_class in self.classes_list:
            print "(Professer: %s Course: %s Durration: %d Lab: %d)" % (course_class.professor, course_class.course, course_class.duration, course_class.lab)
开发者ID:bpross,项目名称:MyCourses-Scheduler,代码行数:37,代码来源:algo_config.py

示例2: get_course_list

# 需要导入模块: from course import Course [as 别名]
# 或者: from course.Course import id [as 别名]
    def get_course_list(self):
        from algorithm.models import School, Department, Class, Prerequisite, Building, Room, Period, Lecturer, ClassInstance, ClassLab, Person, Role, PersonRole 
        from course import Course
        print "This will print out all the courses currently in the database"
    
        self.course_list = []
        all_courses = Class.objects.all()
        
        for Class in all_courses:
           new_course = Course()
           new_course.id = Class.idClass
           new_course.name = Class.Class
           self.course_list.append(new_course)
           self.num_courses += 1

        for Course in self.course_list:
            Course.print_course()
开发者ID:bpross,项目名称:MyCourses-Scheduler,代码行数:19,代码来源:algo_config.py


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