Skip to content

Commit 6dbc94d

Browse files
authored
feat: show the form reference field in the list view and export (#194)
1 parent c1c61e8 commit 6dbc94d

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

docs/settings.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,6 @@ Any settings with their defaults are listed below for quick reference.
2727
WAGTAILSTREAMFORMS_FORM_TEMPLATES = (
2828
('streamforms/form_block.html', 'Default Form Template'),
2929
)
30+
31+
# show the form reference field in the list view and export
32+
WAGTAILSTREAMFORMS_SHOW_FORM_REFERENCE = True

wagtailstreamforms/models/form.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import uuid
22

3+
from django.conf import settings
34
from django.db import models
45
from django.utils.translation import gettext_lazy as _
56
from wagtail import VERSION as WAGTAIL_VERSION
@@ -148,7 +149,8 @@ def get_data_fields(self):
148149
(get_slug_from_string(field["value"]["label"]), field["value"]["label"])
149150
for field in self.get_form_fields()
150151
]
151-
152+
if getattr(settings, "WAGTAILSTREAMFORMS_SHOW_FORM_REFERENCE", False):
153+
data_fields += [("form_reference", _("Form reference"))]
152154
return data_fields
153155

154156
def get_form(self, *args, **kwargs):

0 commit comments

Comments
 (0)