This repository has been archived by the owner on May 16, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replacing auto_now and auto_now_add with default
This makes it possible to override the field value in tests. Refs: - FactoryBoy/factory_boy#102
- Loading branch information
1 parent
16864e2
commit e7026f9
Showing
3 changed files
with
115 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# Copyright (C) 2021 Serghei Iakovlev <egrep@protonmail.ch> | ||
# | ||
# This file is free software; you can redistribute it and/or | ||
# modify it under the terms of the GNU General Public License | ||
# as published by the Free Software Foundation; either version 3 | ||
# of the License, or (at your option) any later version. | ||
# | ||
# This file is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this file. If not, see <https://www.gnu.org/licenses/>. | ||
|
||
import django.utils.timezone | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('blog', '0009_auto_20210414_1352'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='comment', | ||
name='created_at', | ||
field=models.DateTimeField( | ||
default=django.utils.timezone.now, | ||
verbose_name='Date created', | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name='comment', | ||
name='updated_at', | ||
field=models.DateTimeField( | ||
default=django.utils.timezone.now, | ||
verbose_name='Date updated', | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name='post', | ||
name='created_at', | ||
field=models.DateTimeField( | ||
default=django.utils.timezone.now, | ||
verbose_name='Date created', | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name='post', | ||
name='updated_at', | ||
field=models.DateTimeField( | ||
default=django.utils.timezone.now, | ||
verbose_name='Date updated', | ||
), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Copyright (C) 2021 Serghei Iakovlev <egrep@protonmail.ch> | ||
# | ||
# This file is free software; you can redistribute it and/or | ||
# modify it under the terms of the GNU General Public License | ||
# as published by the Free Software Foundation; either version 3 | ||
# of the License, or (at your option) any later version. | ||
# | ||
# This file is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this file. If not, see <https://www.gnu.org/licenses/>. | ||
|
||
import django.utils.timezone | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('pages', '0004_alter_page_no_index'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='page', | ||
name='created_at', | ||
field=models.DateTimeField( | ||
default=django.utils.timezone.now, | ||
verbose_name='Date created', | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name='page', | ||
name='updated_at', | ||
field=models.DateTimeField( | ||
default=django.utils.timezone.now, | ||
verbose_name='Date updated', | ||
), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters