To develop a Django application to store and retrieve data from a Football Players 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 10 Football players
from django.db import models
from django.contrib import admin
class Player(models.Model):
Player_Name=models.CharField(max_length=50)
Jersy_No=models.IntegerField()
Team=models.CharField(max_length=20)
Height=models.IntegerField()
Position=models.CharField(max_length=100)
class Player_Admin(admin.ModelAdmin):
list_display=('Player_Name','Jersy_No','Team','Height','Position')
from django.contrib import admin
from .models import Player,Player_Admin
admin.site.register(Player,Player_Admin)
Thus the program for creating a database using ORM hass been executed successfully.