Skip to content

Commit

Permalink
feat: Перенос приложений в отдельную рабочую директорию.
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonVagabond committed Mar 7, 2024
1 parent 8aa30cf commit 5bea293
Show file tree
Hide file tree
Showing 176 changed files with 60 additions and 85 deletions.
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ celerybeat.pid
*.sage.py

# Environments
.env
src/.env
.venv
env/
venv/
Expand Down Expand Up @@ -167,9 +167,10 @@ media/
/media/
*/media/

migrations/
*/migrations/*
!*/migrations/__init__.py

/.env
/src/.env
/.env.docker
/.idea/
22 changes: 0 additions & 22 deletions carts/constants.py

This file was deleted.

2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ services:
ports:
- "8000:8000"
env_file:
- ./.env
- src/.env
depends_on:
- db
- redis
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion carts/urls.py → src/carts/urls.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from django.urls import path, include
from rest_framework.routers import DefaultRouter

from carts.views import carts
from .views import carts

router = DefaultRouter()

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion common/models/mixins.py → src/common/models/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from django.db import models
from django.utils import timezone

from common.models.base import BaseModel
from .base import BaseModel

User = get_user_model()

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion config/settings.py → src/config/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import sentry_sdk
from celery.schedules import crontab

root = environ.Path(__file__) - 2
root = environ.Path(__file__)
env = environ.Env()
environ.Env.read_env(env.str(root(), default='.env'))

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

from rest_framework.permissions import IsAuthenticated

from delivers.models.couriers import Courier
from delivers.models.delivers import Delivery
from ..models.couriers import Courier
from ..models.delivers import Delivery

if TYPE_CHECKING:
from rest_framework.request import Request
from delivers.views.delivers import DeliveryViewSet
from delivers.views.couriers import CourierViewSet
from ..views.delivers import DeliveryViewSet
from ..views.couriers import CourierViewSet


class IsCourierOrStaff(IsAuthenticated):
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from rest_framework import serializers

from delivers.models.couriers import Courier
from delivers.models.delivers import Delivery
from ...models.couriers import Courier
from ...models.delivers import Delivery
from orders.models.orders import Order


Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from rest_framework import serializers

from delivers.models.couriers import Vehicle
from ...models.couriers import Vehicle


class VehicleListSerializer(serializers.ModelSerializer):
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

if TYPE_CHECKING:
from rest_framework.request import Request
from orders.models.orders import Order
from orders.views.orders import OrderDetailViewSet
from ..models.orders import Order
from ..views.orders import OrderDetailViewSet


class CurrentUserOrStaff(IsAuthenticated):
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from rest_framework import serializers

from payments.models.payments import OrderPayment
from ...models.payments import OrderPayment


class EmptyPaymentSerializer(serializers.ModelSerializer):
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 1 addition & 3 deletions payments/urls.py → src/payments/urls.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
from django.urls import path, include
from django.urls import path

from .views import payments

urlpatterns = [
path('orders/payment_confirmation/', payments.PaymentConfirmationAPIView.as_view(), name='payment_confirmation')
]


File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 2 additions & 1 deletion products/admin.py → src/products/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
from django.utils.safestring import mark_safe, SafeString

from common.admin import ModelaAdminWithImage
from products.models import products, categories, providers
from .models import products, providers
from .models import categories

Provider: TypeAlias = providers.Provider
ProductImages: TypeAlias = products.ProductImages
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

if TYPE_CHECKING:
from rest_framework.request import Request
from products.views.categories import CategoryView
from ..views.categories import CategoryView


class IsStaffOrReadOnly(BasePermission):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

if TYPE_CHECKING:
from rest_framework.request import Request
from products.views.products import ProductView
from products.models.products import Product
from ..views.products import ProductView
from ..models.products import Product


class IsProductProviderOrStaff(IsAuthenticated):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

if TYPE_CHECKING:
from rest_framework.request import Request
from products.views.products import ProductView
from products.views.providers import ProviderView
from products.models.providers import Provider
from ..views.products import ProductView
from ..views.providers import ProviderView
from ..models.providers import Provider


class IsProviderOrStaffOrReadOnly(BasePermission):
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from rest_framework import serializers

from common.serializers import BaseCategorySerializer
from products.models.categories import Category
from ...models.categories import Category


class CategorySearchSerializer(BaseCategorySerializer):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from rest_framework import serializers

from products.models.products import Product
from products.serializers.nested.categories import CategoryNestedSerializer
from products.serializers.nested import products
from products.serializers.nested.providers import ProviderNestedSerializer
from ...models.products import Product
from ..nested.categories import CategoryNestedSerializer
from ..nested import products
from ..nested.providers import ProviderNestedSerializer


class ProductSearchSerializer(serializers.ModelSerializer):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from rest_framework import serializers

from products.models.providers import Provider
from products.serializers.nested.products import ProductNestedSerializer
from ...models.providers import Provider
from ..nested.products import ProductNestedSerializer


class ProviderSearchSerializer(serializers.ModelSerializer):
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from rest_framework import serializers

from products.models.products import Product
from products.serializers.nested.products import ProductImagesNestedSerializer
from ...models.products import Product
from ..nested.products import ProductImagesNestedSerializer


class ProductInternalSerializer(serializers.ModelSerializer):
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from rest_framework import serializers

from products.models.categories import Category
from ...models.categories import Category


class CategoryNestedSerializer(serializers.ModelSerializer):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from rest_framework import serializers

from products.models import products
from products.models.products import Product
from ...models import products
from ...models.products import Product


class ProductImagesNestedSerializer(serializers.ModelSerializer):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from rest_framework import serializers

from products.models.providers import Provider
from ...models.providers import Provider


class ProviderNestedSerializer(serializers.ModelSerializer):
Expand Down
5 changes: 2 additions & 3 deletions products/urls.py → src/products/urls.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
from django.urls import path, include
from rest_framework.routers import DefaultRouter

from products.views import products
from products.views import providers
from products.views import categories
from .views import products, providers
from .views import categories

router = DefaultRouter()

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
from rest_framework_simplejwt import authentication as jwt_authentication

from common.views.mixins import CRUDListViewSet
from products.models.categories import Category
from products.permissions import categories as permissions_cat
from products.serializers.api import categories as categories_s
from ..models.categories import Category
from ..permissions import categories as permissions_cat
from ..serializers.api import categories as categories_s


@extend_schema_view(
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
from rest_framework_simplejwt import authentication as jwt_authentication

from common.views.mixins import CRUDListViewSet
from products.models.providers import Provider
from products.permissions import providers as permissions_prov
from products.serializers.api import providers as providers_s
from ..models.providers import Provider
from ..permissions import providers as permissions_prov
from ..serializers.api import providers as providers_s


@extend_schema_view(
Expand Down
File renamed without changes.
6 changes: 2 additions & 4 deletions users/admin.py → src/users/admin.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
from typing import Union

from django.contrib import admin
from django.contrib.auth import get_user_model
from django.contrib.auth.admin import UserAdmin
from django.utils.safestring import mark_safe, SafeString
from django.utils.translation import gettext_lazy as _

from users.models.users import User
from users.models.profile import Profile
from .models.profile import Profile
from .models.users import User


# region ----------------------------- INLINE ---------------------------------------
Expand Down Expand Up @@ -83,4 +82,3 @@ class UserAdmin(UserAdmin):
inlines = (ProfileAdmin,)
# endregion ---------------------------------------------------------------------
# endregion -------------------------------------------------------------------------

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions users/models/users.py → src/users/models/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
from django.dispatch import receiver
from phonenumber_field.modelfields import PhoneNumberField

from users.managers.users import CustomUserManager
from users.models.profile import Profile
from ..managers.users import CustomUserManager
from ..models.profile import Profile


class User(AbstractUser):
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from rest_framework import serializers
from users.models.profile import Profile
from ...models.profile import Profile


class ProfileShortSerializer(serializers.ModelSerializer):
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions users/services/users.py → src/users/services/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
from djoser import signals
from djoser.conf import settings

from users.views import users as users_views
from users.services.tasks import tasks
from ..views import users as users_views
from ..services.tasks import tasks

if TYPE_CHECKING:
from users.models.users import User
from users.serializers.api.users import CustomPasswordResetConfirmSerializer
from ..models.users import User
from ..serializers.api.users import CustomPasswordResetConfirmSerializer


class UserSignalActivationService:
Expand Down
2 changes: 1 addition & 1 deletion users/services/utils.py → src/users/services/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
if TYPE_CHECKING:
from django.urls import URLPattern
from rest_framework.request import Request
from users.models.users import User
from ..models.users import User


def is_route_selected(url_pattern: URLPattern) -> bool:
Expand Down
6 changes: 3 additions & 3 deletions users/urls.py → src/users/urls.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from django.urls import path, include
from rest_framework.routers import DefaultRouter

from users.services.utils import is_route_selected
from users.views import users
from users.views import auth
from .services.utils import is_route_selected
from .views import users
from .views import auth

router = DefaultRouter()

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 5bea293

Please sign in to comment.