Commit 404a8ebd authored by Star Neptune R. Sy's avatar Star Neptune R. Sy

models are done and migrated

parent cdbb82dc
Pipeline #3037 failed with stages
from django.db import models from django.db import models
import datetime
# Create your models here. class Author(models.Model):
first_name = models.CharField(max_length=50, blank=True)
last_name = models.CharField(max_length=50, blank=True)
age = models.IntegerField(blank=True)
nationality = models.CharField(max_length=50)
bio = models.TextField(blank=True,)
class Book(models.Model):
title = models.CharField(max_length=50, blank=True)
author = models.ForeignKey(
Author,
on_delete=models.CASCADE,
)
publisher = models.CharField(max_length=50, blank=True)
year_published = models.DateField(datetime.datetime.today())
ISBN = models.CharField(max_length=50, unique=True, blank=False, default="0000000000000")
blurb = models.TextField(blank=True,)
\ No newline at end of file
# bookshelf/urls.py
from django.urls import path
from .views import index
urlpatterns = [
path('', index, name='index'),
]
# This might be needed, depending on your Django version
app_name = "bookshelf"
\ 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