我将此模型添加到 models.py
class Documents(models.Model):
id_doc = models.AutoField(primary_key=True, unique=True)
name = models.CharField(max_length=1024, verbose_name='Nom du document')
path = models.ImageField(upload_to="files/", blank=True, null=True, verbose_name="Chemin vers le fichier")
class Meta:
db_table = u'documents'
verbose_name = u'Document'
verbose_name_plural = u'Documents'
def __unicode__(self):
return u'%s' % (self.id_doc)
并在 admin.py
中class DocumentsInline(admin.StackedInline):
model = Documents
inline_classes = ('grp-collapse grp-open')
extra = 1
fk_name = 'name'
我不知道为什么,但是当我尝试执行makemigrations
时,我遇到了这个问题:
<class 'newPrpvApp.admin.DocumentsInline'>: (admin.E202) unsupported format character ''' (0x27) at index 41
你能帮我解决这个错误吗? TY