from django.contrib import admin
from .models import Product
from eav.forms import BaseDynamicEntityForm
from eav.admin import BaseEntityAdmin
Register your models here.
class ProductAdminForm(BaseDynamicEntityForm):
model = Product
class ProductAdmin(BaseEntityAdmin):
form = ProductAdminForm
admin.site.register(Product, ProductAdmin)
出现错误:
Error during template rendering
In template C:\Users\iskander\Desktop\shop\venv\Lib\site-packages\django\contrib\admin
\templates\admin\includes\fieldset.html, error at line 25
<div>
16 {% if not line.fields|length == 1 and not field.is_readonly %}{{ field.errors }}{% endif %}
17 <div class="flex-container{% if not line.fields|length == 1 %} fieldBox{% if field.field.name %} field-{{ field.field.name }}{% endif %}{% if not field.is_readonly and field.errors %} errors{% endif %}{% if field.field.is_hidden %} hidden{% endif %}{% endif %}{% if field.is_checkbox %} checkbox-row{% endif %}">
18 {% if field.is_checkbox %}
19 {{ field.field }}{{ field.label_tag }}
20 {% else %}
21 {{ field.label_tag }}
22 {% if field.is_readonly %}
23 <div class="readonly">{{ field.contents }}</div>
24 {% else %}
25 **{{ field.field }}**
26 {% endif %}
27 {% endif %}
28 </div>
29 {% if field.field.help_text %}
30 <div class="help"{% if field.field.id_for_label %}
id="{{ field.field.id_for_label }}_helptext"{% endif %}>
31 <div>{{ field.field.help_text|safe }}</div>
32 </div>
33 {% endif %}
34 </div>
35 {% endfor %}
我之前尝试安装过,一切正常,但这次不行。我是初学者,正在学习 django
将 django-eav2 版本更改为 1.6.1