51Testing软件测试论坛
标题:
python3.8.0 执行插入数据语句时,报错
[打印本页]
作者:
测试积点老人
时间:
2019-11-26 11:11
标题:
python3.8.0 执行插入数据语句时,报错
python3.8.0 执行插入数据语句时,报错:NameError:name 'Event' is not defined 这是什么原因呢?
语句:
from django.contrib import admin
from sign.models import Event, Guest
# Register your models here.
class EventAdmin(admin.ModelAdmin):
list_display = ['name','status','start_time','id']
search_fields = ['name'] # 搜索栏
list_filter = ['status'] # 过滤器
class GuestAdmin(admin.ModelAdmin):
list_display = ['realname','phone','email','sign','create_time','event']
search_fields = ['realname','phone'] # 搜索栏
list_filter = ['sign'] # 过滤器
admin.site.register(Event,EventAdmin)
admin.site.register(Guest,GuestAdmin)
复制代码
作者:
bellas
时间:
2019-11-27 09:27
没有定位到name这个字段
作者:
qqq911
时间:
2019-11-27 11:49
检查下导入
作者:
jingzizx
时间:
2019-11-27 12:07
注册事件
作者:
Miss_love
时间:
2019-12-14 17:24
欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/)
Powered by Discuz! X3.2