add: add full_text fields
This commit is contained in:
@@ -0,0 +1,28 @@
|
|||||||
|
# Generated by Django 5.2 on 2025-09-27 14:37
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('common', '0007_userterms_text_en_userterms_text_ru_and_more'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='aboutus',
|
||||||
|
name='full_text',
|
||||||
|
field=models.TextField(null=True),
|
||||||
|
),
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='news',
|
||||||
|
name='full_text',
|
||||||
|
field=models.TextField(null=True),
|
||||||
|
),
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='service',
|
||||||
|
name='full_text',
|
||||||
|
field=models.TextField(null=True),
|
||||||
|
),
|
||||||
|
]
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
# Generated by Django 5.2 on 2025-09-27 14:38
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('common', '0008_aboutus_full_text_news_full_text_service_full_text'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='aboutus',
|
||||||
|
name='full_text_en',
|
||||||
|
field=models.TextField(null=True),
|
||||||
|
),
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='aboutus',
|
||||||
|
name='full_text_ru',
|
||||||
|
field=models.TextField(null=True),
|
||||||
|
),
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='aboutus',
|
||||||
|
name='full_text_uz',
|
||||||
|
field=models.TextField(null=True),
|
||||||
|
),
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='news',
|
||||||
|
name='full_text_en',
|
||||||
|
field=models.TextField(null=True),
|
||||||
|
),
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='news',
|
||||||
|
name='full_text_ru',
|
||||||
|
field=models.TextField(null=True),
|
||||||
|
),
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='news',
|
||||||
|
name='full_text_uz',
|
||||||
|
field=models.TextField(null=True),
|
||||||
|
),
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='service',
|
||||||
|
name='full_text_en',
|
||||||
|
field=models.TextField(null=True),
|
||||||
|
),
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='service',
|
||||||
|
name='full_text_ru',
|
||||||
|
field=models.TextField(null=True),
|
||||||
|
),
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='service',
|
||||||
|
name='full_text_uz',
|
||||||
|
field=models.TextField(null=True),
|
||||||
|
),
|
||||||
|
]
|
||||||
@@ -32,6 +32,7 @@ class Banner(BaseModel):
|
|||||||
class AboutUs(BaseModel):
|
class AboutUs(BaseModel):
|
||||||
title = models.CharField(max_length=200)
|
title = models.CharField(max_length=200)
|
||||||
description = models.TextField()
|
description = models.TextField()
|
||||||
|
full_text = models.TextField(null=True)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.title
|
return self.title
|
||||||
@@ -67,6 +68,7 @@ class Service(BaseModel):
|
|||||||
text = models.TextField()
|
text = models.TextField()
|
||||||
icon = models.ImageField(upload_to='service/icons/')
|
icon = models.ImageField(upload_to='service/icons/')
|
||||||
image = models.ImageField(upload_to='service/images/')
|
image = models.ImageField(upload_to='service/images/')
|
||||||
|
full_text = models.TextField(null=True)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.title
|
return self.title
|
||||||
@@ -104,6 +106,7 @@ class News(BaseModel):
|
|||||||
image = models.ImageField(unique='news/images/')
|
image = models.ImageField(unique='news/images/')
|
||||||
title = models.CharField(max_length=300)
|
title = models.CharField(max_length=300)
|
||||||
text = models.TextField()
|
text = models.TextField()
|
||||||
|
full_text = models.TextField(null=True)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.title
|
return self.title
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ class AboutUsSerializer(serializers.ModelSerializer):
|
|||||||
class Meta:
|
class Meta:
|
||||||
model = models.AboutUs
|
model = models.AboutUs
|
||||||
fields = [
|
fields = [
|
||||||
'id', 'title', 'description', 'images', 'features'
|
'id', 'title', 'description', 'full_text', 'images', 'features'
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
@@ -50,14 +50,14 @@ class ServiceListSerializer(serializers.ModelSerializer):
|
|||||||
class Meta:
|
class Meta:
|
||||||
model = models.Service
|
model = models.Service
|
||||||
fields = [
|
fields = [
|
||||||
'id', 'title', 'text', 'icon', 'image',
|
'id', 'title', 'text', 'icon', 'image', 'full_text'
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
class NewsSerializer(serializers.ModelSerializer):
|
class NewsSerializer(serializers.ModelSerializer):
|
||||||
class Meta:
|
class Meta:
|
||||||
model = models.News
|
model = models.News
|
||||||
fields = ['id', 'image', 'title', 'text']
|
fields = ['id', 'image', 'title', 'text', 'full_text']
|
||||||
|
|
||||||
|
|
||||||
class ContactUsSerializer(serializers.ModelSerializer):
|
class ContactUsSerializer(serializers.ModelSerializer):
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ class BannerTranslation(translator.TranslationOptions):
|
|||||||
@translator.register(models.AboutUs)
|
@translator.register(models.AboutUs)
|
||||||
class AboutUsTranslation(translator.TranslationOptions):
|
class AboutUsTranslation(translator.TranslationOptions):
|
||||||
fields = [
|
fields = [
|
||||||
'title', 'description',
|
'title', 'description', 'full_text'
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
@@ -27,14 +27,14 @@ class AboutUsFeatureTranslation(translator.TranslationOptions):
|
|||||||
@translator.register(models.Service)
|
@translator.register(models.Service)
|
||||||
class ServiceTranslation(translator.TranslationOptions):
|
class ServiceTranslation(translator.TranslationOptions):
|
||||||
fields = [
|
fields = [
|
||||||
'title', 'text',
|
'title', 'text', 'full_text'
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
@translator.register(models.News)
|
@translator.register(models.News)
|
||||||
class NewsTranslation(translator.TranslationOptions):
|
class NewsTranslation(translator.TranslationOptions):
|
||||||
fields = [
|
fields = [
|
||||||
'title', 'text'
|
'title', 'text', 'full_text'
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user