StreamField: js error in adding component field
See original GitHub issueIssue Summary
Error in back-office when trying to add items in a StreamField
Steps to Reproduce
- Define a StreamField :
class EventPage(PublicationItemPage):
"""
Simple event, providing:
+ date/time start
+ date/time end
+ location
+ audience
+ a signup link
"""
#: Date from
date_from = models.DateField(verbose_name=_('Start date'))
#: Date to
date_to = models.DateField(verbose_name=_('End date'),
null=True, blank=True,
help_text=_('Not required if event is on a single day'))
#: Time from
time_from = models.TimeField(verbose_name=_('Start time'), null=True, blank=True)
#: Time to
time_to = models.TimeField(verbose_name=_('End time'), null=True, blank=True)
#: Audience can be `private` or `public`
audience = models.CharField(verbose_name=_('Audience'), max_length=255, choices=EVENT_AUDIENCE_CHOICES)
#: A Location
location = models.ForeignKey('publications.Location',
verbose_name=_('Location'),
on_delete=models.SET_NULL,
null=True, blank=True)
#: A description of the event
body = StreamField([('paragraph', blocks.RichTextBlock()),
('image', ImageChooserBlock()),
('url', blocks.URLBlock()),
('date', blocks.DateBlock()),
('page', blocks.PageChooserBlock())],
verbose_name=_('Body'),
null=True, blank=True)
- Defines some content panels
# Content panels
content_panels = [FieldPanel('title', classname="full title"),
FieldPanel('date_from'),
FieldPanel('date_to'),
FieldPanel('time_from'),
FieldPanel('time_to'),
FieldPanel('location'),
FieldPanel('audience'),
FieldPanel('signup_link'),
FieldPanel('body'), ]
-
When adding a new Event, I’ve some weird comportment
-
When recording, I’ve a 500 error :
Internal Server Error: /admin/pages/add/publications/eventpage/7/
MultiValueDictKeyError at /admin/pages/add/publications/eventpage/7/ “u’body-0-deleted’”
Technical details
- Python version: 2.7.9
- Django version: 1.10.6
- Wagtail version: 1.9
- Browser version: firefox 51 / firefox 52 / chrome 57
Issue Analytics
- State:
- Created 7 years ago
- Comments:6
Top Results From Across the Web
Using Stream Field in WagTail throws an error in block content
Error message is: 'richtext' template filter received an invalid value; expected string, got <class 'wagtail.core.blocks.stream_block.
Read more >How to use StreamField for mixed content
StreamField is a model field that can be defined within your page model like any ... be used - including using it as...
Read more >Solved: Can't add Components Field to Issue Context and Ne...
Go to project settings > Issue types; Locate the issue type to which you want to add the component and click on the...
Read more >SQL Error Messages | InterSystems IRIS Data Platform 2022.2
The table below lists the SQL numeric error codes and their error ... -21, Pointer->Field reference may not be modified by an INSERT...
Read more >Custom StreamField Field Validation - LearnWagtail.com
Occasionally we as developers would like to add additional field validation to ... if errors: raise ValidationError('Validation error in ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yeah, got it, StreamFieldPanel solves the problem, Sorry !
@frague59 Did you see my comment, I believe we commented at the same time? Did that solve your issue?