-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from hackathone-prosept-team2/feat/add_del_prices
Feat/add del prices
- Loading branch information
Showing
11 changed files
with
106 additions
and
38 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
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,24 @@ | ||
# Generated by Django 4.2.7 on 2023-11-29 13:20 | ||
|
||
from django.db import migrations, models | ||
|
||
from apps.services.fixtures_parser import get_prices_datasets | ||
|
||
|
||
def create_prices(apps, schema_editor): | ||
DealerPrice: models.Model = apps.get_model("prices", "DealerPrice") | ||
prices_datasets = get_prices_datasets() | ||
if prices_datasets: | ||
prices = [DealerPrice(**fields) for fields in prices_datasets] | ||
DealerPrice.objects.bulk_create(prices, ignore_conflicts=True) | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("prices", "0001_initial"), | ||
("dealers", "0003_dealerkey_unique_pair_dealer_and_key"), | ||
] | ||
|
||
operations = [ | ||
migrations.RunPython(create_prices), | ||
] |
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 |
---|---|---|
@@ -1,4 +1,16 @@ | ||
from dataclasses import dataclass | ||
|
||
# Настройки общей пагинации | ||
COMMON_PAGE = 50 | ||
# Настройки вложенной в объект пагинации (история цен) | ||
NESTED_PAGE = 3 | ||
NESTED_PAGE = 10 | ||
# Кол-во выводимых предложений аналогов | ||
MATCH_NUMBER = 10 | ||
|
||
|
||
# Статусы ключей дилеров | ||
@dataclass | ||
class KeyStatus: | ||
CHECK = "На проверку" | ||
DECLINED = "Не подходит" | ||
FOUND = "Подтверждено" |