Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed #25005 - Made DateTime and DateTimeField with auto_now/auto_now_add use effective default #4891

Closed
wants to merge 1 commit into from

Conversation

coldmind
Copy link
Contributor

https://code.djangoproject.com/ticket/25005

This is PoC.
If auto_now or auto_now_add are used, no need to ask for default value, need to use effective default.

I'm opening it against 1.8, but I doubt if this behavior need to be changed for 1.8.
This changes seems something for 1.9.

@@ -201,6 +202,12 @@ def effective_default(self, field):
default = six.binary_type()
else:
default = six.text_type()
elif (field.get_internal_type() == 'DateField'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't handle TimeField.

@MarkusH
Copy link
Member

MarkusH commented Jun 21, 2015

Can you combine the autodetector tests to test against all three date related fields at once.

…_add use effective default

Also fixed autodetector in migrations to skip promt for default for
these fields.
@coldmind
Copy link
Contributor Author

Closing, opened new PR against master (#4902)

@coldmind coldmind closed this Jun 21, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants