[英]How do I use button on card to change a session value?
I am making a menu that goes through a few different steps.我正在制作一个经过几个不同步骤的菜单。 Select the grade, then select the textbook, then select the lesson.
选择年级,然后选择教科书,然后选择课程。 I want to display the textbooks as cards with buttons that will bring the user to a view of all the lessons associated with that textbook.
我想将教科书显示为带有按钮的卡片,这些按钮将使用户看到与该教科书相关的所有课程。 I've used session to go from the grade to the textbook, but I'm not sure how to go from the textbook to the lessons.
我已经使用 session 从成绩到教科书,但我不确定如何从教科书到课程。 I think the way of getting there is to have the button change the session value to that textbook, and bring me to the view that will filter the lessons by that textbook, but I'm not sure how to do that.
我认为到达那里的方法是让按钮将会话值更改为该教科书,并将我带到将按该教科书过滤课程的视图,但我不确定如何做到这一点。 Any suggestions would be welcome!
欢迎大家提出意见!
Django just isn't capable of rendering a form with choices as images. Django 只是无法渲染带有选项作为图像的表单。 This can only be achieved with a some Java Script or other front end tools.
这只能通过一些 Java Script 或其他前端工具来实现。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.