摘要: https://qiita.com/ANKM0/items/8fb032b6af7e64756d69 类似于这个页面 在考核系统中,我是用的 tamplate tag,关联读取显示的信息 {% if field.name == "beikao_user" %} {{ field }} {{ user 阅读全文
posted @ 2023-07-10 16:49 花生与酒 阅读(4) 评论(0) 推荐(0) 编辑
摘要: 中文例子和讲解: https://www.cnblogs.com/waltsmith/p/8088099.html https://realpython.com/tutorials/django/ Table of Contents Creating a Django Project Getting 阅读全文
posted @ 2023-07-10 15:41 花生与酒 阅读(24) 评论(0) 推荐(0) 编辑
摘要: 1、使用ModelFormSet,一般都要设定default数,方法如下 class Memo(models.Model): title = models.CharField('タイトル', max_length=20) text = models.TextField('内容') class Mem 阅读全文
posted @ 2023-07-10 10:16 花生与酒 阅读(23) 评论(0) 推荐(0) 编辑
摘要: calories隐含字段,通过计算得出的例子 from django import forms from .models import Nutrient class NutrientForm(forms.ModelForm): name = forms.CharField(label='食品名', 阅读全文
posted @ 2023-07-10 09:59 花生与酒 阅读(23) 评论(0) 推荐(0) 编辑