Skip to content
Snippets Groups Projects
Commit ed4014e1 authored by hiruthikj's avatar hiruthikj
Browse files

Initial Commit

parent 0874afc2
No related branches found
No related tags found
No related merge requests found
File added
from django.db import models
class Genre(models.Model):
genre_name = models.CharField(max_length=100, unique=True)
def __str__(self):
return self.genre_name
class Author(models.Model):
author_name = models.CharField(max_length=100, unique=True)
def __str__(self):
return self.author_name
class Book(models.Model):
book_title = models.CharField(max_length=100)
author_fk = models.ForeignKey('Author', on_delete=models.CASCADE)
genres = models.ManyToManyField('Genre')
description = models.TextField(max_length=400, null=True, blank=True)
price = models.FloatField(help_text="In rupees (₹)")
def __str__(self):
return self.book_title
from django.test import TestCase
# Create your tests here.
from django.shortcuts import render
# Create your views here.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment