Files
octopus/ГИД ПО ЗАПУСКУ
Andrey Smakotin 5d5de1fe31 Рефакторинг: перенос логики создания временных комплектов в сервис
Изменения:
- Удалена функция create_temporary_kit из myproject/orders/views.py
- Перенесена в новый сервис myproject/products/services/kit_service.py
- Добавлен API endpoint products:api-temporary-kit-create для создания временных комплектов
- Обновлены URL-ы соответственно

Преимущества:
- Логика временных комплектов теперь находится в соответствующем приложении (products)
- Упрощена архитектура orders приложения
- Сервис может быть переиспользован в других контекстах
- Лучшее разделение ответственности между приложениями

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-10 23:44:05 +03:00

44 lines
1.2 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
docker run -d `
--name postgres17 `
-e POSTGRES_PASSWORD=postgres `
-e POSTGRES_USER=postgres `
-e POSTGRES_DB=inventory_db `
-p 5432:5432 `
-v postgres17-data:/var/lib/postgresql/data `
postgres:17
# 2. Создаем миграции с нуля
python manage.py makemigrations
# 3. Применяем все миграции
python manage.py migrate
# 4. Создаем главного тенанта (если нужно)
python manage.py shell
# Внутри shell:
from tenants.models import Client, Domain
client = Client.objects.create(
name='Main',
schema_name='public'
)
Domain.objects.create(
domain='localhost',
tenant=client,
is_primary=True
)
exit()
# 5. Создаем суперпользователя для public схемы
python manage.py createsuperuser
# 6. Создаем суперпользователя для конкретного тенанта (опционально)
python manage.py shell
# Внутри:
from tenants.models import Client
from django.core.management import call_command
from django_tenants.utils import schema_context
client = Client.objects.get(schema_name='public')
with schema_context(client):
call_command('createsuperuser')
exit()