Change data model

This commit is contained in:
Barunes Padhy 2024-05-24 09:02:22 +03:00
parent 7781c5c3e4
commit 4bb5b6aa8e
2 changed files with 5 additions and 4 deletions

View File

@ -3,6 +3,6 @@ userdata = {
"intro_content": "<p>Write something about yourself</p>",
"profile_photo": "",
"default_theme": "darkTheme",
"dark_theme": "{\"darkTheme\": { \"theme\": \"Dark Mode\",\"background\": \"bg-dark\",\"textColor\": \"text-white\",\"linkBackground\": \"bg-light\",\"linkTextColor\": \"text-black\",\"captionColor\": \"#8a8a8a\",\"fontAwesomeIcon\": \"faSun\",\"borderColor\": \"secondary\",\"buttonColor\": \"light\",\"navBar\": {\"navBarTheme\": \"navbar-dark\",\"background\": \"bg-secondary\",\"buttonColor\": \"light\"},\"footer\": {\"background\": \"bg-secondary\",\"text\": \"bg-white\"}}}",
"light_theme": "{\"lightTheme\":{\"theme\": \"Light Mode\",\"background\": \"bg-light\",\"textColor\": \"text-black\",\"linkBackground\": \"bg-dark\",\"linkTextColor\": \"text-white\",\"captionColor\": \"#605f5f\",\"fontAwesomeIcon\": \"faMoon\",\"borderColor\": \"secondary\",\"buttonColor\": \"dark\",\"navBar\": {\"navBarTheme\": \"navbar-light\",\"background\": \"bg-secondary\",\"buttonColor\": \"light\"},\"footer\": {\"background\": \"bg-secondary\",\"text\": \"bg-white\"}}}"
"dark_theme": "{\"theme\": \"Dark Mode\",\"background\": \"bg-dark\",\"textColor\": \"text-white\",\"linkBackground\": \"bg-light\",\"linkTextColor\": \"text-black\",\"captionColor\": \"#8a8a8a\",\"fontAwesomeIcon\": \"faSun\",\"borderColor\": \"secondary\",\"buttonColor\": \"light\",\"navBar\": {\"navBarTheme\": \"navbar-dark\",\"background\": \"bg-secondary\",\"buttonColor\": \"light\"},\"footer\": {\"background\": \"bg-secondary\",\"text\": \"text-black\"}}",
"light_theme": "{\"theme\": \"Light Mode\",\"background\": \"bg-light\",\"textColor\": \"text-black\",\"linkBackground\": \"bg-dark\",\"linkTextColor\": \"text-white\",\"captionColor\": \"#605f5f\",\"fontAwesomeIcon\": \"faMoon\",\"borderColor\": \"secondary\",\"buttonColor\": \"dark\",\"navBar\": {\"navBarTheme\": \"navbar-light\",\"background\": \"bg-secondary\",\"buttonColor\": \"light\"},\"footer\": {\"background\": \"bg-secondary\",\"text\": \"text-white\"}}"
}

View File

@ -1,3 +1,4 @@
import uuid
from django.db import models
from .initialize_data import userdata
@ -10,7 +11,7 @@ class UserData(models.Model):
light_theme = models.CharField(default=userdata["light_theme"], null=False, blank=False, max_length=1500)
class Category(models.Model):
category_id = models.SlugField()
category_id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
featured_id = models.CharField(null=True, blank=True, max_length=500)
name = models.CharField(null=False, blank=False, max_length=200)
description = models.CharField(null=False, blank=False, max_length=200)
@ -19,7 +20,7 @@ class Category(models.Model):
class Blog(models.Model):
blog_id = models.SlugField()
blog_id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
name = models.CharField(null=False, blank=False, max_length=200)
description = models.CharField(null=False, blank=False, max_length=200)
tagline = models.CharField(null=False, blank=False, max_length=200)