大家好,我需要在 django admin 中导入 excel 文件我找到了这个视频,我应用了这些步骤,但我有行号:1 - name 'name' is not defined error我该如何解决这个问题?
models.py
from django.db import models
class Ekle(models.Model):
name = models.CharField(max_length = 50, blank = False)
lastname = models.CharField(max_length = 50)
price = models.CharField(max_length = 50)
def __str__(self):
return name
admin.py
from django.contrib import admin
from .models import *
from import_export.admin import ImportExportModelAdmin
@admin.register(Ekle)
class ViewAdmin(ImportExportModelAdmin):
pass
陪伴而非守候
相关分类