This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Generated by Django 4.0.5 on 2022-06-29 20:33 | |
from django.db import migrations | |
DEFAULT_CATEGORY = "Uncategorised" | |
def add_default_category(apps, _): | |
category_model = apps.get_model(app_label="blog", model_name="Category") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.db import models | |
from autoslug import AutoSlugField | |
from django.urls import reverse | |
class Genre(models.Model): | |
name = models.CharField(max_length=100) | |
api_id = models.IntegerField(unique=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datetime import datetime | |
from django.db import IntegrityError | |
from django.test import TestCase | |
from django.urls import reverse | |
from django.utils.text import slugify | |
from .models import Genre, Movie |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.db import models | |
from django.contrib import auth | |
USER = auth.get_user_model() | |
class UserProfile(models.Model): | |
user = models.OneToOneField(to=USER, related_name="profile", on_delete=models.PROTECT) | |
first_name = models.CharField(max_length=255) | |
last_name = models.CharField(max_length=255) | |
bio = models.TextField() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datetime import datetime | |
from django.db import IntegrityError | |
from django.test import TestCase | |
from django.urls import reverse | |
from django.utils.text import slugify | |
from .models import Genre, Movie |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.db import models | |
from autoslug import AutoSlugField | |
from django.utils.text import slugify | |
class Genre(models.Model): | |
name = models.CharField(max_length=100) | |
api_id = models.IntegerField(unique=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Generated by Django 4.0.5 on 2022-06-04 18:08 | |
import autoslug.fields | |
from django.db import migrations | |
from django.utils.text import slugify | |
DEFAULT = "abc" | |
def forwards(apps, _): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% load static %} | |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<link rel="stylesheet" href="{% static 'css/styles.css' %}" rel="stylesheet"> | |
<title>Django Cinema</title> | |
</head> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.test import TestCase, Client | |
from django.urls import reverse | |
from .models import Todo | |
# Create your tests here. | |
todo_title = "Book Dentist Appointment" | |
class TestTodoModel(TestCase): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.test import TestCase | |
from .models import Todo | |
# Create your tests here. | |
todo_title = "Book Dentist Appointment" | |
class TestTodoModel(TestCase): | |
def setUp(self): |
NewerOlder