To develop a Django application to store and retrieve data from a Book database using Object Relational Mapping(ORM).
Clone the problem from GitHub
Create a new app in Django project
Enter the code for admin.py and models.py
Execute Django admin and create details for 10 books
admin.py
from django.contrib import admin
from .models import book_DB,book_DBAdmin
admin.site.register(book_DB,book_DBAdmin)
models.py
from django.db import models
from django.contrib import admin
class Book_dbs(models.Model):
bookno=models.IntegerField(primary_key=True);
bookname=models.CharField(max_length=10);
authorname=models.CharField(max_length=10);
yearofpublishing=models.DateField();
pages=models.IntegerField();
price=models.IntegerField();
class book_DBAdmin(admin.ModelAdmin):
list_display=("bookno","bookname","authorname","yearofpublishing","pages","price");
Thus the program for creating a database using ORM hass been executed successfully

