'Wagtail Admin: How to Add ReadOnlyBlocks to show snippets fields values in a StructBlock
I have a Snippet model(SampleSnippet) with fields field_a, field_b, and field_c. And I am using it in a StructBlock like:
class SampleBlock(blocks.StructBlock):
service_snippet = SnippetChooserBlock(SampleSnippet)
...
Now I want to show some of the SampleSnippet fields(field_a and field_b) in SampleBlock after saving the SampleBlock for the first time(after saving the snippet) on the wagtail admin site. How can I achieve this? I looked around a lot but couldn't find a similar issue.
If it were a model/snippet, I could have used property with ReadOnlyPanel but in the case of a StructBlock, I am stuck and not getting any ideas. If anybody knows any way to achieve this, please help me out. Thanks in advance.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
