zoukankan      html  css  js  c++  java
  • CRM开发学员课程系统——我的课程学习记录

    #student/urls.py
    #课程学习记录
     url(r'mycourse/(d+)$',views.mycourse,name='mycourse'),

    通过报名表的对象找到关联的学习记录表值

    #student/views.py
    def mycourse(request,enroll_id):
        """我的课程页面"""
        #找到报名表对象
        enroll_obj = models.Enrollment.objects.get(id=enroll_id)
        return render(request,"student/mycourse.html",{"enroll_obj":enroll_obj})
    #student/mycourse.py
    {% extends 'index.html'%}
    {% block page-content %}
    {% load stu_tags %}
    <div class="panel panel-default">
      <div class="panel-body">
        {{enroll_obj.enrolled_class.course}}
      </div>
      <div class="panel panel-default">
          <!-- Default panel contents -->
          <!-- Table -->
          <table class="table">
              <thead>
                <tr>
                    <th>课程节次</th>
                    <th>上课课程</th>
                    <th>是否有作业</th>
                    <th>作业标题</th>
                    <th>签到状态</th>
                    <th>成绩</th>
                    <th>作业详情</th>
                </tr>
              </thead>
              <tbody>
              {% for studyrecord in enroll_obj.studyrecord_set.all %}
                <tr>
                    <td>{{studyrecord.course_record.day_num}}</td>
                    <td>{{studyrecord.course_record.date}}</td>
                    <td>{{studyrecord.course_record.has_homework}}</td>
                    <td>{{studyrecord.course_record.homework_title}}</td>
                    <td>{{studyrecord.get_attendance_display}}</td>
                    <td>{{studyrecord.score}}</td>
                    <td><a href="{% url 'my_homework' studyrecord.id %}">作业详情</a></td>
                </tr>
              {% endfor %}
              </tbody>
          </table>
      </div>
    </div>
    {% endblock%}
  • 相关阅读:
    Composer autoload 自动加载
    权限问题
    加载适配器和布局之间的顺序关系--Unsolved
    listview和button
    线程练习中出现的错误
    线程02
    关于初始化成员变量
    可扩展列表
    Android开发中Handler的经典总结----转载
    线程01
  • 原文地址:https://www.cnblogs.com/venvive/p/11503945.html
Copyright © 2011-2022 走看看