>>> students = Students.objects.all() # The queryset's model class: >>> students.model project.app.models.Student # Name of the model class: >>> students.model.__name__ 'Student' # Import path of the models module: >>> students.model.__module__ 'project.app.models' # Django app name: >>> students.model._Meta.app_label 'app'
@H_404_3@解决方法
我有 学生 模型的空查询集 __
students = Students.objects.all()
如果以上查询集为空,那么我如何获取模型(类名)?
如何获取空查询集的型号名称?
编辑:
如何从查询集中获取应用名称?
students = Students.objects.all()
我有 学生 模型的空查询集 __
如果以上查询集为空,那么我如何获取模型(类名)?
如何获取空查询集的型号名称?
编辑:
如何从查询集中获取应用名称?