【发布时间】:2021-12-08 03:28:36
【问题描述】:
models.py
description = RichTextField(blank=True, null=True)
admin.py
description = "*text1/*text2/*text3"
desired_output = "*text1
*text2
*text3"
#我尝试使用替换,但它不起作用 - description.replace("/", "\n")
#replace 无法在 RichTextField 中获取换行符 任何解决方案?
【问题讨论】:
标签: python python-3.x django django-models