-
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resolved bug cloning models with UniqueConstraint. (#423)
* Resolved bug cloning models with UniqueConstraint. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fixed test. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fixed test. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fixed test. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fixed test. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Updated test. * Updated test. * Updated test. * Update utils.py * Update test_clone_mixin.py * Update test_clone_mixin.py * Update test_clone_mixin.py * Update test_clone_mixin.py * Update utils.py Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
- Loading branch information
1 parent
72b5b15
commit 45530f6
Showing
7 changed files
with
268 additions
and
15 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
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
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
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
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,30 @@ | ||
# Generated by Django 3.2.5 on 2021-07-17 20:26 | ||
|
||
import django | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("sample", "0018_auto_20210628_2301"), | ||
] | ||
|
||
operations = ( | ||
[ | ||
migrations.AddConstraint( | ||
model_name="saletag", | ||
constraint=models.UniqueConstraint( | ||
fields=("name",), name="sale_tag_unique_name" | ||
), | ||
), | ||
] | ||
if django.VERSION >= (2, 2) | ||
else [ | ||
migrations.AlterField( | ||
model_name="saletag", | ||
name="name", | ||
field=models.CharField(max_length=255, unique=True), | ||
), | ||
] | ||
) |
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,42 @@ | ||
# Generated by Django 3.2.5 on 2021-07-17 22:30 | ||
import django | ||
from django.db import migrations, models | ||
|
||
import sample.models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("sample", "0019_saletag_sale_tag_unique_name"), | ||
] | ||
|
||
operations = ( | ||
[ | ||
migrations.AlterField( | ||
model_name="tag", | ||
name="name", | ||
field=models.CharField( | ||
default=sample.models.get_unique_tag_name, max_length=255 | ||
), | ||
), | ||
migrations.AddConstraint( | ||
model_name="tag", | ||
constraint=models.UniqueConstraint( | ||
fields=("name",), name="tag_unique_name" | ||
), | ||
), | ||
] | ||
if django.VERSION >= (2, 2) | ||
else [ | ||
migrations.AlterField( | ||
model_name="tag", | ||
name="name", | ||
field=models.CharField( | ||
default=sample.models.get_unique_tag_name, | ||
max_length=255, | ||
unique=True, | ||
), | ||
), | ||
] | ||
) |
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