1.进入xadmin添加测试数据(教师.课程) 2.把以下4个前端页面复制到templates中 先打开这几个页面分析,它们和之前的课程机构列表页是不一样的机构,且没有共同的部分,但是这4个页面却是类似的,因此它们不能基于之前的base.html来做模板,我们再创建一个模板文件org_base.html 3.把org-detail-homepage.html的内容拷贝到org_base.html中 4.编辑org_base.html,替换静态文件(css/js/images) 5.把会变化的内容…
对应github地址:第9天   一. 实现我要学习功能…
1.复制teacher-detail.html到templates目录下 2.编辑teacher-detail.html,继承base.html 3.编辑organization.view.py class TeacherDetailView(View): def get(self, request, teacher_id): teacher = Teacher.objects.get(id=teacher_id) return render(request, 'teacher-detail.h…
对应github地址:第13天   把teacher-list.html和teacher-detail.html拷贝过来   一. 授课讲师列表页   1. 修改html文件 把org-list.html的页面内容拷贝到teacher-list.html中,替换面包屑和conteng内容…
对应github地址:第11天   一. 课程详情页2   1. 课程详情页第2块中的课程介绍中,修改course-detail.html中代码,搜索课程详情,找到如下代码…
1.把course-detail.html复制到templates目录下 2.编辑course-detail.html,分析页面,继承base.html 3.编辑courses.views .... class CourseDetailView(View): def get(self, request, course_id): return render(request, 'course-detail.html', {}) 4.创建一个url,编辑courses.urls.py ... from…
这里点击"收藏"也是ajax异步操作,我在operation.model.py中创建了一个用户收藏表,其中fav_id字段,如果我们收藏的是课程,那就是课程id,如果收藏的是课程机构,那就是课程机构id,如果收藏的是讲师,那就是讲师id. 编辑organization.views.py ... from operation.models import UserFavorite class UserFavView(View): def post(self, request): fav_i…
1.查看详细信息,以弹窗的形式显示,使用ajax 2.批量删除 “查询”功能可以参考前面的文章,这里只讲解ajax“显示弹窗详情”和“删除”功能 第一:在body中的代码 <title>ajax汽车网页查询</title> <script src="jquery-2.0.0.min.js"></script> <script type="text/javascript" src="tanchuang.j…
对应github地址:第10天   一. 课程列表页   1. 拷贝course-list.html到templates目录中 2. 编写url和view 在courses/views.py中新加…
对应github地址:列表分页和按条件筛选     一. 列表分页   1. pip install django-pure-pagination   2. settings.py中 install app中添加'pure_pagination', 设置参数…