diff --git a/README.md b/README.md index f45329b3..31cc17d2 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Ex02 Django ORM Web Application -# Date: +# Date:22-09-2025 # AIM To develop a Django application to store and retrieve data from a bank loan database using Object Relational Mapping(ORM). @@ -17,9 +17,37 @@ Enter the code for admin.py and models.py ## STEP 4: Execute Django admin and create details for 10 books -# PROGRAM +# PROGRAM: +admin.py +``` +from django.contrib import admin +from .models import Car,CarAdmin +admin.site.register(Car,CarAdmin) +``` +model.py +``` +from django.db import models +from django.contrib import admin + +class Car(models.Model): + car_name = models.CharField(max_length=100) + brand = models.CharField(max_length=100) + year = models.IntegerField() + price = models.DecimalField(max_digits=10, decimal_places=2) + speed=models.IntegerField() + + + +class CarAdmin(admin.ModelAdmin): + list_display = ('car_name', 'brand', 'year', 'price','speed') + + +``` + # OUTPUT -Include the screenshot of your admin page. +Screenshot 2025-09-23 131627 + + # RESULT Thus the program for creating a database using ORM hass been executed successfully diff --git a/Screenshot 2025-09-22 201015.png b/Screenshot 2025-09-22 201015.png new file mode 100644 index 00000000..7a18f93d Binary files /dev/null and b/Screenshot 2025-09-22 201015.png differ