To develop a Django application to store and retrieve data from a Car Inventory 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
from django.db import models
from django.contrib import admin
class Car2(models.Model):
car_name = models.CharField()
car_model = models.CharField()
release_date = models.DateField()
millage = models.IntegerField()
colour = models.CharField()
class Car2Admin(admin.ModelAdmin):
list_display = ('car_name', 'car_model', 'release_date', 'millage', 'colour')
from django.contrib import admin
from.models import Car2,Car2Admin
admin.site.register(Car2,Car2Admin)
Thus the program for creating car inventory database database using ORM hass been executed successfully
