0.0.2 init, blocks prepare

This commit is contained in:
SDE
2023-11-26 14:31:30 +03:00
parent 74f7bbb24b
commit 53687e240d
20 changed files with 475 additions and 33 deletions

0
ServicesApp/__init__.py Normal file
View File

3
ServicesApp/admin.py Normal file
View File

@@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.

6
ServicesApp/apps.py Normal file
View File

@@ -0,0 +1,6 @@
from django.apps import AppConfig
class ServicesappConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'ServicesApp'

View File

24
ServicesApp/models.py Normal file
View File

@@ -0,0 +1,24 @@
from django.db import models
from BaseModels.base_models import *
from django.utils.translation import gettext_lazy as _
class Section(BaseModelViewPage):
class Meta:
verbose_name = _('Раздел сайта')
verbose_name_plural = _('Разделы сайта')
class Service(BaseModelViewPage):
section = models.ForeignKey(
Section, verbose_name=_('Раздел'),
on_delete=models.SET_NULL, related_name='rel_services_for_section',
null=True, blank=True
)
parent_service = models.ForeignKey(
'Service', verbose_name=_('Родитель'),
on_delete=models.SET_NULL, related_name='rel_children_for_service',
null=True, blank=True
)
class Meta:
verbose_name = _('Услуга')
verbose_name_plural = _('Услуги')

3
ServicesApp/tests.py Normal file
View File

@@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

3
ServicesApp/views.py Normal file
View File

@@ -0,0 +1,3 @@
from django.shortcuts import render
# Create your views here.