mirror of
https://github.com/HamzaSha1/zod-backend.git
synced 2025-07-15 10:05:21 +00:00
FAQ list and creation
This commit is contained in:
18
junior/migrations/0028_faq_status.py
Normal file
18
junior/migrations/0028_faq_status.py
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
# Generated by Django 4.2.2 on 2023-08-17 10:28
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('junior', '0027_alter_faq_question'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='faq',
|
||||||
|
name='status',
|
||||||
|
field=models.IntegerField(blank=True, default=1, null=True),
|
||||||
|
),
|
||||||
|
]
|
@ -222,10 +222,12 @@ class JuniorArticleCard(models.Model):
|
|||||||
|
|
||||||
class FAQ(models.Model):
|
class FAQ(models.Model):
|
||||||
"""FAQ model"""
|
"""FAQ model"""
|
||||||
# Total earned points"""
|
# questions"""
|
||||||
question = models.CharField(max_length=100)
|
question = models.CharField(max_length=100)
|
||||||
# referral points"""
|
# answer"""
|
||||||
description = models.CharField(max_length=500)
|
description = models.CharField(max_length=500)
|
||||||
|
# status
|
||||||
|
status = models.IntegerField(default=1, null=True, blank=True)
|
||||||
created_at = models.DateTimeField(auto_now_add=True)
|
created_at = models.DateTimeField(auto_now_add=True)
|
||||||
updated_at = models.DateTimeField(auto_now=True)
|
updated_at = models.DateTimeField(auto_now=True)
|
||||||
|
|
||||||
|
@ -517,8 +517,3 @@ class FAQSerializer(serializers.ModelSerializer):
|
|||||||
model = FAQ
|
model = FAQ
|
||||||
fields = ('id', 'question', 'description')
|
fields = ('id', 'question', 'description')
|
||||||
|
|
||||||
def create(self, validated_data):
|
|
||||||
# validate data
|
|
||||||
print("validated_data===>",validated_data)
|
|
||||||
faq = FAQ.objects.bulk_create(**validated_data)
|
|
||||||
return faq
|
|
||||||
|
Reference in New Issue
Block a user