31/10/23
To develop a Django application to store and retrieve data from a Football Players database using Object Relational Mapping(ORM).
Include your ER diagram here
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 10 Football players
Models.py
from django.db import models from django.contrib import admin class Players(models.Model): pid=models.CharField(max_length=20,help_text="Player ID") name=models.CharField(max_length=100) team=models.CharField(max_length=50) age=models.IntegerField() rating=models.IntegerField()
class PlayerAdmin(admin.ModelAdmin): list_display=('pid','name','team','age','rating')
admin.py
from django.contrib import admin from .models import Players,PlayerAdmin admin.site.register(Players,PlayerAdmin)
%
20(2).png)
Include the screenshot of your admin page.
Thus the program for creating a database using ORM hass been executed successfully