操作系统 - Windows10 Python - 3.7.4 Django - 2.1
我想展示这个模型。像这样在这里输入图片描述
但我不知道。我怎样才能做到这一点。我试图解决这个问题 3 个月 :( 我已经有了 MySQL 数据库。所以,我必须保留这些数据结构(模型)
管理继承?覆盖 Django Admin 中的查询集?
我不知道该怎么做。我不明白 Queryset,str,ORM...
因为我刚开始使用 Django 3 个月。
我必须解决这个问题。一个视图中的多个模型(表==类)(模板)
但我不能.. 请告诉我提示,解决方案,任何事情
from django.conf import settings
from django.db import models
from django.utils import timezone
class Exam(models.Model):
idexam = models.IntegerField(primary_key=True)
trueanswernum = models.IntegerField(db_column='trueAnswerNum', blank=True, null=True) # Field name made lowercase.
falseanswernum = models.IntegerField(db_column='falseAnswerNum', blank=True, null=True) # Field name made lowercase.
exammain = models.TextField(db_column='examMain', blank=True, null=True) # Field name made lowercase.
questionsubmain …Run Code Online (Sandbox Code Playgroud) django django-templates django-models django-forms django-views