Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 31 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -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).

Expand All @@ -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.
<img width="1911" height="793" alt="Screenshot 2025-09-23 131627" src="https://github.com/user-attachments/assets/999f49a8-80a6-4964-aeb2-d03c41e26c8c" />



# RESULT
Thus the program for creating a database using ORM hass been executed successfully
Binary file added Screenshot 2025-09-22 201015.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.