This repository has been archived by the owner on Dec 13, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CPA-324 Refactoring management commands
- [x] evaluate_contract_equity - [x] evaluate_contract_red_flag - [x] export_country_contracts - [x] export_summary_report - [x] fetch_covid_active_cases - [x] import_tender_from_id - [x] process_currency_conversion - [x] summarize_country_buyer - [x] summarize_country_supplier Split into files - [x] Tasks - [x] Models - [x] Serializers
- Loading branch information
Kushal Raj Shrestha
committed
Jul 18, 2021
1 parent
7e3cd29
commit de6f9ee
Showing
68 changed files
with
2,354 additions
and
2,018 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from django.core.management.base import BaseCommand | ||
|
||
from country.models import Country | ||
from country.tasks import evaluate_contract_equity | ||
|
||
|
||
class Command(BaseCommand): | ||
help = "Evaluate country contracts for equity indicators" | ||
|
||
def add_arguments(self, parser): | ||
parser.add_argument("country_code", type=str, help="Country code") | ||
|
||
def handle(self, *args, **kwargs): | ||
country_code = kwargs["country_code"].upper() | ||
|
||
try: | ||
Country.objects.get(country_code_alpha_2=country_code) | ||
except Exception: | ||
return self.stdout.write("Invalid country code provided") | ||
|
||
evaluate_contract_equity.apply_async(args=(country_code,), queue="covid19") | ||
|
||
return "Done" |
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,21 @@ | ||
from django.core.management.base import BaseCommand | ||
|
||
from country.models import Country | ||
from country.tasks import country_contract_excel | ||
|
||
|
||
class Command(BaseCommand): | ||
help = "Export country contracts into excel file." | ||
|
||
def add_arguments(self, parser): | ||
parser.add_argument("country_code", type=str, help="Country code") | ||
|
||
def handle(self, *args, **kwargs): | ||
country_code = kwargs["country_code"].upper() | ||
|
||
try: | ||
Country.objects.get(country_code_alpha_2=country_code) | ||
except Exception: | ||
return self.stdout.write("Invalid country code provided") | ||
|
||
country_contract_excel.apply_async(args=(country_code,), queue="covid19") |
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
14 changes: 0 additions & 14 deletions
14
country/management/commands/generate_country_contract_excel.py
This file was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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.