Commit 8222a430 authored by Star Neptune R. Sy's avatar Star Neptune R. Sy

added get_absolute_url. DIdn't reset anything

parent bdbd3cf4
# Generated by Django 3.2 on 2023-03-29 04:00
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('bookshelf', '0002_alter_book_year_published'),
]
operations = [
migrations.AlterField(
model_name='book',
name='year_published',
field=models.DateField(default=datetime.datetime(2023, 3, 29, 12, 0, 26, 639804)),
),
]
......@@ -11,7 +11,8 @@ class Author(models.Model):
def __str__(self):
return "{} {}".format(self.first_name, self.last_name)
def get_absolute_url(self):
return self.pk
class Book(models.Model):
......@@ -26,4 +27,7 @@ class Book(models.Model):
blurb = models.TextField(blank=True,)
def __str__(self):
return self.title
\ No newline at end of file
return self.title
def get_absolute_url(self):
return self.pk
\ No newline at end of file
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