diff --git a/backend/apimanager/initialize_data.py b/backend/apimanager/initialize_data.py index c6395e4..cfddf72 100644 --- a/backend/apimanager/initialize_data.py +++ b/backend/apimanager/initialize_data.py @@ -3,6 +3,6 @@ userdata = { "intro_content": "
Write something about yourself
", "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\"}}" } \ No newline at end of file diff --git a/backend/apimanager/models.py b/backend/apimanager/models.py index ba4ea3b..7473bad 100644 --- a/backend/apimanager/models.py +++ b/backend/apimanager/models.py @@ -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)