create sitemanagement project and dynamic faqs
This commit is contained in:
0
backend/sitemanagement/__init__.py
Normal file
0
backend/sitemanagement/__init__.py
Normal file
4
backend/sitemanagement/admin.py
Normal file
4
backend/sitemanagement/admin.py
Normal file
@@ -0,0 +1,4 @@
|
||||
from django.contrib import admin
|
||||
from .models import FAQ
|
||||
|
||||
admin.site.register(FAQ)
|
||||
6
backend/sitemanagement/apps.py
Normal file
6
backend/sitemanagement/apps.py
Normal file
@@ -0,0 +1,6 @@
|
||||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class SitemanagementConfig(AppConfig):
|
||||
default_auto_field = 'django.db.models.BigAutoField'
|
||||
name = 'sitemanagement'
|
||||
27
backend/sitemanagement/migrations/0001_initial.py
Normal file
27
backend/sitemanagement/migrations/0001_initial.py
Normal file
@@ -0,0 +1,27 @@
|
||||
# Generated by Django 5.2.1 on 2025-05-15 16:24
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='FAQ',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('title', models.CharField(max_length=250)),
|
||||
('content', models.CharField(max_length=800)),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'FAQ',
|
||||
'verbose_name_plural': 'FAQs',
|
||||
'ordering': ['id'],
|
||||
},
|
||||
),
|
||||
]
|
||||
0
backend/sitemanagement/migrations/__init__.py
Normal file
0
backend/sitemanagement/migrations/__init__.py
Normal file
14
backend/sitemanagement/models.py
Normal file
14
backend/sitemanagement/models.py
Normal file
@@ -0,0 +1,14 @@
|
||||
from django.db import models
|
||||
|
||||
class FAQ (models.Model):
|
||||
title = models.CharField(max_length=250)
|
||||
content = models.CharField(max_length=800)
|
||||
|
||||
class Meta:
|
||||
verbose_name = 'FAQ'
|
||||
verbose_name_plural = 'FAQs'
|
||||
ordering = ['id']
|
||||
|
||||
def __str__(self):
|
||||
return self.title
|
||||
|
||||
3
backend/sitemanagement/tests.py
Normal file
3
backend/sitemanagement/tests.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
||||
Reference in New Issue
Block a user