0.0.12 services for section
This commit is contained in:
@@ -73,12 +73,14 @@ class Admin_Service(SuperModelAdmin, Admin_Trans_BaseModelViewPage):
|
||||
fieldsets = [
|
||||
(None, {
|
||||
'classes': ['wide'],
|
||||
'fields': ('name',
|
||||
'url',
|
||||
'title', 'description', 'text',
|
||||
'picture',
|
||||
'order',
|
||||
)
|
||||
'fields': (
|
||||
'section', 'parent_service',
|
||||
'name',
|
||||
'url',
|
||||
'title', 'description', 'text',
|
||||
'picture',
|
||||
'order',
|
||||
)
|
||||
}),
|
||||
('SEO', {
|
||||
'classes': ['wide', 'collapse'],
|
||||
@@ -95,7 +97,7 @@ class Admin_Service(SuperModelAdmin, Admin_Trans_BaseModelViewPage):
|
||||
'order', 'modifiedDT', 'createDT'
|
||||
]
|
||||
|
||||
prepopulated_fields = {"url": ("name",)}
|
||||
prepopulated_fields = {"url": ("name_en",)}
|
||||
|
||||
list_display_links = ['id']
|
||||
list_editable = ['order']
|
||||
|
||||
18
ServicesApp/migrations/0002_alter_service_url.py
Normal file
18
ServicesApp/migrations/0002_alter_service_url.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 4.2.7 on 2023-11-26 19:55
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('ServicesApp', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='service',
|
||||
name='url',
|
||||
field=models.TextField(blank=True, null=True, verbose_name='URL привязанной страницы'),
|
||||
),
|
||||
]
|
||||
@@ -9,6 +9,9 @@ class Section(BaseModelViewPage):
|
||||
|
||||
|
||||
class Service(BaseModelViewPage):
|
||||
|
||||
url = models.TextField(verbose_name=_('URL привязанной страницы'), null=True, blank=True)
|
||||
|
||||
section = models.ForeignKey(
|
||||
Section, verbose_name=_('Раздел'),
|
||||
on_delete=models.SET_NULL, related_name='rel_services_for_section',
|
||||
|
||||
Reference in New Issue
Block a user