CreationDateTimeField is not editable even with editable=True in version 1.5.7
See original GitHub issueI have a test that is passing using django-extensions 1.5.5 but fails in 1.5.7. The test tries to set a CreationDateTimeField
and save a model, but the model does not get updated.
I have the following abstract model that some of my models inherit from:
class AuditModel(models.Model):
date_created = fields.CreationDateTimeField(editable=True)
# ...
class Meta:
abstract = True
And a model that extends AuditModel
:
class SetPasswordToken(AuditModel):
# Other fields
Here’s the test:
def test_set_password_redirects_to_login_if_older_than_30_days(self):
user = UserFactory()
token = SetPasswordToken.objects.create(user=user,
date_created=timezone.now() - relativedelta(days=60))
# Test that relies on date_created not being today
When I use pdb
after creating a SetPasswordToken
I see that token.date_created
is set to today, even though it is supposed to be set to 60 days ago. I also tried creating a token, explicitly setting token.date_created
, then calling token.save()
and it still will not be set to 60 days ago. This test works properly on version 1.5.5.
Issue Analytics
- State:
- Created 8 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
contenteditable - HTML: HyperText Markup Language | MDN
Chrome Edge
contenteditable Full support. ChromeYes. Toggle history Full suppo...
contenteditable="caret". Experimental Full support. ChromeYes. Toggle history Full suppo...
contenteditable="events". Experimental Full support. ChromeYes. Toggle history...
Read more >contenteditable=false inside contenteditable=true block is still ...
It worked! So, to make a span NON-contenteditable inside a contenteditable div, you just set its contenteditable attribute to true !
Read more >HTML Global contenteditable Attribute - W3Schools
The contenteditable attribute specifies whether the content of an element is editable or not. Note: When the contenteditable attribute is not set on...
Read more >Make a HTML element editable with contenteditable
Apply the contenteditable attribute and you can edit it similar to or . Users can click on the text and make an update...
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
Not fixed / still a problem. Likely due to https://github.com/django-extensions/django-extensions/pull/693 (https://github.com/django-extensions/django-extensions/commit/818f602214a3ea8144c184d5cf1ed41de0ae426c): Django overwrites editable/blank unconditionally (see https://github.com/django/django/pull/12274 for a fix).
Better to keep this closed and directly submit a PR 😃