-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LocalUnit: Create, Update, Revert, Latest changes Apis (#2336)
* Add Create,Update,Validate Apis logics * Add changes in apis and add new migration file * Add local units enums to global enums * Add test cases for local units apis * Add latest changes api for local units - validate the location - Revert API - add test cases * Update logics on latest-change-request api
- Loading branch information
Showing
9 changed files
with
417 additions
and
37 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,5 @@ | ||
from . import models | ||
|
||
enum_register = { | ||
"deprecate_reason": models.LocalUnit.DeprecateReason, | ||
} |
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 |
---|---|---|
|
@@ -13,6 +13,7 @@ class Meta: | |
"type__code", | ||
"draft", | ||
"validated", | ||
"is_locked", | ||
) | ||
|
||
|
||
|
26 changes: 26 additions & 0 deletions
26
local_units/migrations/0020_alter_localunitchangerequest_options_and_more.py
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,26 @@ | ||
# Generated by Django 4.2.16 on 2024-12-10 09:09 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("local_units", "0019_alter_localunit_is_deprecated_alter_localunit_status_and_more"), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterModelOptions( | ||
name="localunitchangerequest", | ||
options={"ordering": ("id",)}, | ||
), | ||
migrations.RemoveField( | ||
model_name="localunit", | ||
name="status", | ||
), | ||
migrations.AddField( | ||
model_name="localunit", | ||
name="is_locked", | ||
field=models.BooleanField(default=False, verbose_name="Is locked?"), | ||
), | ||
] |
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
Oops, something went wrong.