我想將表單添加到w block塊。該表單是一個簡單的下拉選擇與提交按鈕。 class ExampleForm(forms.Form):
example = forms.ModelChoiceField(queryset=Example.objects.all())
然後鶺鴒塊是與GET_CONTEXT生成一個簡單的表格() # this is basically the view r
我想在django中使用燈具設置單元測試。 我可以成功地加載我的賽程,但是當我試圖檢索他們的數據出現錯誤: DoesNotExist: BlogIndexPage matching query does not exist. 這裏是我的測試(我使用的鶺鴒CMS代碼,延伸單元測試與a few additional methods): class BlogTests(WagtailPageTests)
有沒有比這更好的方法來製作固定內容的ListBlock的子類? class MixedMediaCarouselBlock(blocks.ListBlock):
"""
A hghly streamlined CarouselBlock which displays only Images and/or Videos.
"""
def __init__(s
我有以下StructBlock和StreamBlock如下: class AccordionItemBlock(StructBlock):
title = CharBlock()
text = RichTextBlock()
class AccordionRepeaterBlock(StreamBlock):
accordion_item = AccordionI