модели
This commit is contained in:
parent
5a47423c19
commit
014ef1b0d2
|
@ -0,0 +1,6 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="PyCharmProfessionalAdvertiser">
|
||||||
|
<option name="shown" value="true" />
|
||||||
|
</component>
|
||||||
|
</project>
|
|
@ -3,3 +3,20 @@ from django.db import models
|
||||||
# Create your models here.
|
# Create your models here.
|
||||||
class Seo(models.Model):
|
class Seo(models.Model):
|
||||||
id = models.AutoField(primary_key=True)
|
id = models.AutoField(primary_key=True)
|
||||||
|
text = models.CharField(max_length=200, help_text='введите текст')
|
||||||
|
email = models.EmailField(help_text="введите Email")
|
||||||
|
blank = models.TextField(blank=True, null=True)
|
||||||
|
image = models.ImageField(default=True)
|
||||||
|
|
||||||
|
|
||||||
|
class KupiZabor(models.Model):
|
||||||
|
title = models.CharField(max_length=200)
|
||||||
|
content = models.TextField()
|
||||||
|
url = models.CharField(max_length=200) # URL страницы
|
||||||
|
meta_title = models.CharField(max_length=200, blank=True, null=True) # Мета-тег Title
|
||||||
|
meta_description = models.TextField(blank=True, null=True) # Мета-тег Description
|
||||||
|
keywords = models.CharField(max_length=200, blank=True, null=True) # Ключевые слова
|
||||||
|
is_indexed = models.BooleanField(default=True) # Показывать ли страницу в поисковых системах
|
||||||
|
|
||||||
|
def __str__(self):
|
||||||
|
return self.title
|
|
@ -8,4 +8,4 @@ logger = logging.getLogger("root")
|
||||||
class SeoSerializer(serializers.ModelSerializer):
|
class SeoSerializer(serializers.ModelSerializer):
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Seo
|
model = Seo
|
||||||
fields = ["id"]
|
fields = ["id", "text", "email", "blank", "image"]
|
Loading…
Reference in New Issue