错误:
'list' object has no attribute '_meta'
表格.py:
from django.db import models
from django.forms import ModelForm
from django import forms
class Blog(models.Model):
blog_id = models.CharField(max_length=100)
class TumblrForm(ModelForm):
class Meta:
model = Blog
fields = ('blog_id',)
widgets = {
'blog_id':forms.RadioSelect(),
}
表单创建:
form = TumblrForm(instance=blogs_id) #blogs_id is a list of blog urls
我哪里错了?