فهرست منبع

Simplify example of appending a rich text block to a streamfield

Matt Westcott 11 ماه پیش
والد
کامیت
b0cda80626
1فایلهای تغییر یافته به همراه1 افزوده شده و 2 حذف شده
  1. 1 2
      docs/topics/streamfield.md

+ 1 - 2
docs/topics/streamfield.md

@@ -514,8 +514,7 @@ my_page.body[0] = ('heading', "My story")
 del my_page.body[-1]
 
 # Append a rich text block to the stream
-from wagtail.rich_text import RichText
-my_page.body.append(('paragraph', RichText("<p>And they all lived happily ever after.</p>")))
+my_page.body.append(('paragraph', "<p>And they all lived happily ever after.</p>"))
 
 # Save the updated data back to the database
 my_page.save()