-
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.
Merge pull request #14 from maykinmedia/feature/6-product-types-api
Feature/6 product types api
- Loading branch information
Showing
37 changed files
with
4,760 additions
and
55 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
39 changes: 37 additions & 2 deletions
39
...types/migrations/0003_alter_field_type.py → ...y_alter_question_product_type_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
29 changes: 29 additions & 0 deletions
29
src/open_producten/producttypes/migrations/0004_alter_priceoption_amount.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,29 @@ | ||
# Generated by Django 4.2.13 on 2024-08-30 13:33 | ||
|
||
from decimal import Decimal | ||
import django.core.validators | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
( | ||
"producttypes", | ||
"0003_alter_question_category_alter_question_product_type_and_more", | ||
), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name="priceoption", | ||
name="amount", | ||
field=models.DecimalField( | ||
decimal_places=2, | ||
help_text="The amount of the price option", | ||
max_digits=8, | ||
validators=[django.core.validators.MinValueValidator(Decimal("0.01"))], | ||
verbose_name="Price", | ||
), | ||
), | ||
] |
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,69 @@ | ||
from django.urls import include, path | ||
|
||
from rest_framework_nested.routers import DefaultRouter, NestedSimpleRouter | ||
|
||
from open_producten.producttypes.views import ( | ||
CategoryQuestionViewSet, | ||
CategoryViewSet, | ||
ConditionViewSet, | ||
ProductTypeFieldViewSet, | ||
ProductTypeLinkViewSet, | ||
ProductTypePriceViewSet, | ||
ProductTypeQuestionViewSet, | ||
ProductTypeViewSet, | ||
TagTypeViewSet, | ||
TagViewSet, | ||
) | ||
|
||
ProductTypesRouter = DefaultRouter() | ||
ProductTypesRouter.register("producttypes", ProductTypeViewSet, basename="producttype") | ||
|
||
ProductTypesLinkRouter = NestedSimpleRouter( | ||
ProductTypesRouter, "producttypes", lookup="product_type" | ||
) | ||
ProductTypesLinkRouter.register( | ||
r"links", ProductTypeLinkViewSet, basename="producttype-link" | ||
) | ||
|
||
ProductTypesPriceRouter = NestedSimpleRouter( | ||
ProductTypesRouter, "producttypes", lookup="product_type" | ||
) | ||
ProductTypesPriceRouter.register( | ||
r"prices", ProductTypePriceViewSet, basename="producttype-price" | ||
) | ||
|
||
ProductTypesQuestionRouter = NestedSimpleRouter( | ||
ProductTypesRouter, "producttypes", lookup="product_type" | ||
) | ||
ProductTypesQuestionRouter.register( | ||
r"questions", ProductTypeQuestionViewSet, basename="producttype-question" | ||
) | ||
|
||
ProductTypesFieldRouter = NestedSimpleRouter( | ||
ProductTypesRouter, "producttypes", lookup="product_type" | ||
) | ||
ProductTypesFieldRouter.register( | ||
r"fields", ProductTypeFieldViewSet, basename="producttype-field" | ||
) | ||
|
||
ProductTypesRouter.register("categories", CategoryViewSet, basename="category") | ||
|
||
CategoriesQuestionRouter = NestedSimpleRouter( | ||
ProductTypesRouter, "categories", lookup="category" | ||
) | ||
CategoriesQuestionRouter.register( | ||
r"questions", CategoryQuestionViewSet, basename="category-question" | ||
) | ||
|
||
ProductTypesRouter.register("conditions", ConditionViewSet, basename="condition") | ||
ProductTypesRouter.register("tags", TagViewSet, basename="tag") | ||
ProductTypesRouter.register("tagtypes", TagTypeViewSet, basename="tagtype") | ||
|
||
product_type_urlpatterns = [ | ||
path("", include(ProductTypesRouter.urls)), | ||
path("", include(ProductTypesLinkRouter.urls)), | ||
path("", include(ProductTypesPriceRouter.urls)), | ||
path("", include(ProductTypesQuestionRouter.urls)), | ||
path("", include(ProductTypesFieldRouter.urls)), | ||
path("", include(CategoriesQuestionRouter.urls)), | ||
] |
File renamed without changes.
Oops, something went wrong.