#24170: DateTimeRangeField: widget doesn't implement decompress()
-------------------------------------+-------------------------------------
Reporter: joelburton | Owner: nobody
Type: Uncategorized | Status: new
Component: Database layer | Version: 1.8alpha1
(models, ORM) | Keywords: DateTimeRangeField
Severity: Normal | decompress
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
1. Create a model with a DateTimeRangeField and another field (I used just
one other, a SlugField)
2. Via the admin, add a record with a valid slug and datetimerange
3. Try to edit the record, changing the slug
(This was done with a Postgres backend)
This traceback is produced:
{{{
Environment:
Request Method: POST
Request URL: http://localhost:8000/admin/homework/homework/3/
Django Version: 1.8a1
Python Version: 3.4.2
Installed Applications:
('django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.postgres',
'homework')
Installed Middleware:
('django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'django.middleware.security.SecurityMiddleware')
Traceback:
File "/Users/joel/programming/django18play/venv/lib/python3.4/site-
packages/django/core/handlers/base.py" in get_response
131. response = wrapped_callback(request,
*callback_args, **callback_kwargs)
File "/Users/joel/programming/django18play/venv/lib/python3.4/site-
packages/django/contrib/admin/options.py" in wrapper
615. return self.admin_site.admin_view(view)(*args,
**kwargs)
File "/Users/joel/programming/django18play/venv/lib/python3.4/site-
packages/django/utils/decorators.py" in _wrapped_view
110. response = view_func(request, *args, **kwargs)
File "/Users/joel/programming/django18play/venv/lib/python3.4/site-
packages/django/views/decorators/cache.py" in _wrapped_view_func
54. response = view_func(request, *args, **kwargs)
File "/Users/joel/programming/django18play/venv/lib/python3.4/site-
packages/django/contrib/admin/sites.py" in inner
226. return view(request, *args, **kwargs)
File "/Users/joel/programming/django18play/venv/lib/python3.4/site-
packages/django/contrib/admin/options.py" in change_view
1518. return self.changeform_view(request, object_id, form_url,
extra_context)
File "/Users/joel/programming/django18play/venv/lib/python3.4/site-
packages/django/utils/decorators.py" in _wrapper
34. return bound_func(*args, **kwargs)
File "/Users/joel/programming/django18play/venv/lib/python3.4/site-
packages/django/utils/decorators.py" in _wrapped_view
110. response = view_func(request, *args, **kwargs)
File "/Users/joel/programming/django18play/venv/lib/python3.4/site-
packages/django/utils/decorators.py" in bound_func
30. return func.__get__(self, type(self))(*args2,
**kwargs2)
File
"/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/contextlib.py"
in inner
30. return func(*args, **kwds)
File "/Users/joel/programming/django18play/venv/lib/python3.4/site-
packages/django/contrib/admin/options.py" in changeform_view
1472. change_message =
self.construct_change_message(request, form, formsets)
File "/Users/joel/programming/django18play/venv/lib/python3.4/site-
packages/django/contrib/admin/options.py" in construct_change_message
1020. if form.changed_data:
File "/Users/joel/programming/django18play/venv/lib/python3.4/site-
packages/django/forms/forms.py" in changed_data
466. if field.has_changed(initial_value, data_value):
File "/Users/joel/programming/django18play/venv/lib/python3.4/site-
packages/django/forms/fields.py" in has_changed
1126. initial = self.widget.decompress(initial)
File "/Users/joel/programming/django18play/venv/lib/python3.4/site-
packages/django/forms/widgets.py" in decompress
850. raise NotImplementedError('Subclasses must implement this
method.')
Exception Type: NotImplementedError at /admin/homework/homework/3/
Exception Value: Subclasses must implement this method.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/24170>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/053.e21cebc1eae660eda70c8879a70336c6%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.