From 4f4d4c5c108d3c6dc2989e9410684288cb42f55b Mon Sep 17 00:00:00 2001 From: Egor fureunoir Gorbunov Date: Tue, 20 May 2025 14:12:32 +0300 Subject: [PATCH] Features: 1) Add AddressViewSet to API routing; 2) Add `is_publicly_visible` attribute to Address model; Fixes: Extra: 1) Minor import addition for AddressViewSet in api_urls.py; --- core/api_urls.py | 2 ++ core/models.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/core/api_urls.py b/core/api_urls.py index cda652ea..6a7c7c96 100644 --- a/core/api_urls.py +++ b/core/api_urls.py @@ -14,6 +14,7 @@ from core.views import ( sitemap_index, ) from core.viewsets import ( + AddressViewSet, AttributeGroupViewSet, BrandViewSet, CategoryViewSet, @@ -39,6 +40,7 @@ core_router.register(r"feedbacks", FeedbackViewSet, basename="feedbacks") core_router.register(r"stocks", StockViewSet, basename="stocks") core_router.register(r"promo_codes", PromoCodeViewSet, basename="promo_codes") core_router.register(r"promotions", PromotionViewSet, basename="promotions") +core_router.register(r"addresses", AddressViewSet, basename="addresses") sitemaps = { 'products': ProductSitemap, diff --git a/core/models.py b/core/models.py index d1e1d1ad..3894846d 100644 --- a/core/models.py +++ b/core/models.py @@ -1230,6 +1230,8 @@ class Documentary(NiceModel): class Address(NiceModel): + is_publicly_visible = False + street = CharField(_("street"), max_length=255, null=True) # noqa: DJ001 district = CharField(_("district"), max_length=255, null=True) # noqa: DJ001 city = CharField(_("city"), max_length=100, null=True) # noqa: DJ001