﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
27186	Cannot change DateTimeField with default via Admin since Django 1.10.1	Michael Käufl	nobody	"Since Django 1.10.1 (it worked in 1.10.0), it is not possible to change the value of a DateTimeField in the admin if the field has a default.

Changing the value and saving the object results in the old value still being in the database.


== How to reproduce ==

I created a small [https://github.com/michael-k/datetimefieldbroken example project] to easily reproduce the problem.

It has a [https://github.com/michael-k/datetimefieldbroken/blob/b6ff942dd328007bf4af199b91d20d6cbfbb09d5/datetimefieldbroken/main/models.py#L5-L7 model ''Dummy''] with two DateTimeFields.  One ''with'' and one ''without'' a default (''django.utils.timezone.now'').  The [https://github.com/michael-k/datetimefieldbroken/blob/b6ff942dd328007bf4af199b91d20d6cbfbb09d5/datetimefieldbroken/main/admin.py#L6-L8 admin] is the default ''django.contrib.admin.ModelAdmin''.


{{{
git clone https://github.com/michael-k/datetimefieldbroken.git && cd datetimefieldbroken
docker-compose build --pull
docker-compose run web migrate
docker-compose run web createsuperuser
docker-compose up -d
}}}

Head your browser to [http://localhost:8023/admin/main/dummy/add/], login and create a new ''Dummy'' using ''Save and continue editing''.  Change the values all for input fields and press ''Save and continue editing'' again.  The values of ''Dt with default'' are unchanged.



== Patch that introduced the issue ==

We belive that [https://github.com/django/django/pull/7195/files PR 7195] (redaring [https://code.djangoproject.com/ticket/27039 issue 27039]) introduced the problem, but did not validate this.  Supposedly this happens because DateTimeField is split into two fields (date + time) in the admin.

We tried it however with Django 1.10.0 and it works just fine.
"	Uncategorized	new	Forms	1.10	Normal				Unreviewed	0	0	0	0	0	0
