我已将 wagtail 添加到现有的 Django 站点。我希望将模型的内容部分更改为 RealTextField。我有什么和我改变了什么如下所示:
class Post(models.Model):
content = models.TextField()
class Meta:
ordering = ['-date_added']
def __str__(self):
return self.title
Post(models.Model):
content = RichTextField()
class Meta:
ordering = ['-date_added']
content_panels = Page.content_panels + [
FieldPanel('content', classname="full"),
]
def __str__(self):
return self.title
class Meta:
ordering = ['-date_added']
content_panels = Page.content_panels + [
FieldPanel('content', classname="full"),
]
def __str__(self):
return self.title