Skip to content

SivaMohan-cloud/django-orm-app

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Django ORM Web Application

AIM

To develop a Django application to store and retrieve data from a database using Object Relational Mapping(ORM).

Entity Relationship Diagram

djangoer

DESIGN STEPS

STEP 1:

clone the repository from github.

STEP 2:

create an admin interface for django

STEP 3:

create an app and edit settings.py

STEP 4:

make migrations and migrate the changes.

STEP 5:

create admin user and write python code for admin and models.

STEP 6:

make all the migrations to 'myapp'.

STEP 7:

create an student database with 10 fields using runserver command.

PROGRAM

Models.py

from django.db import models
from django.contrib import admin

# Create your models here.
class Student (models.Model):
    referencenumber=models.CharField(primary_key=True,max_length=20,help_text="reference number")
    name=models.CharField(max_length=100)
    age=models.IntegerField()
    email=models.EmailField()
    phoneno=models.IntegerField()

class StudentAdmin(admin.ModelAdmin):
    list_display=('referencenumber','name','age','email','phoneno')

Admin.py

from django.contrib import admin
from .models import Student,StudentAdmin


# Register your models here.
admin.site.register(Student,StudentAdmin)

OUTPUT

Server Output:

djangooutput1

Client Output:

djangooutput2

RESULT

The program for creating an student database using ORM is executed sucessfully.

About

No description, website, or topics provided.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 100.0%