Commit 71c46880 authored by Ilham Maulana's avatar Ilham Maulana 💻

fix: book and category relations

parent 8d5dee33
# Generated by Django 5.0.7 on 2024-07-31 07:46
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('book', '0007_remove_book_category_book_category'),
]
operations = [
migrations.AlterField(
model_name='book',
name='category',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='book.category'),
),
]
......@@ -21,7 +21,7 @@ class Book(models.Model):
isbn = models.CharField(max_length=15, default="xxxxxxxxx-x")
description = models.CharField(max_length=255, blank=True, null=True)
cover_image = models.ImageField(upload_to="uploads", blank=True, null=True)
category = models.OneToOneField(
category = models.ForeignKey(
Category, on_delete=models.SET_NULL, blank=True, null=True
)
created_at = models.DateTimeField(auto_now_add=True)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment