Opened 7 years ago
Closed 7 years ago
#29197 closed Bug (invalid)
TemplateDoesNotExist: postgres/widgets/split_array.html
Reported by: | linluc | Owned by: | nobody |
---|---|---|---|
Component: | contrib.postgres | Version: | 2.0 |
Severity: | Normal | Keywords: | postgres template SplitArrayWidget |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
In my model I use:
user_choices = ArrayField(models.BooleanField(), default=[], size=5)
then on the form, in the widgets section (first import: from django.contrib.postgres.forms import SplitArrayWidget):
'user_choices' : SplitArrayWidget(forms.CheckboxInput(),5)
The above combination throws:
Django Version: 2.0.1
Exception Type: TemplateDoesNotExist
Exception Value: postgres/widgets/split_array.html
The issue seems easy to fix, by either fixing the path in "/lib/python3.4/site-packages/django/contrib/postgres/forms/array.py", which currently reads:
template_name = 'postgres/widgets/split_array.html'
or by moving the postgres template directory, which is located one level above.
Change History (1)
comment:1 by , 7 years ago
Component: | Uncategorized → contrib.postgres |
---|---|
Resolution: | → invalid |
Status: | new → closed |
Type: | Uncategorized → Bug |
Probably you don't have
django.contrib.postgres
in yourINSTALLED_APPS
, or you've otherwise incorrectly configured widget rendering.