Regarding Django models.

26 views
Skip to first unread message

MANISH YADAV

unread,
Jun 18, 2020, 3:53:07 PM6/18/20
to Django users
hello community members,
I am a student and interested in Django. can you please help me.
I am designing a project in Django. For that, I have my database schema which consists of the composite primary key and composite foreign key. But Django does not support any type of composite key.
I have tried out but unable to solve it. I am giving a sample of the database schema so you can understand better.

DATABASE SCHEMA

Department (deptId, dept_name, head_id, dept_exe_id)   ---->  deptId is primary key

AcademicYear (deptId, year)                                             ----->  deptIds references from Department and (deptId, year) composite primary key

Semester (deptId, year, sem)                                            ------> deptId, year is references from AcademicYear and (deptId, year, sem) composite primary key

Division (deptId, year, sem, div, batch)                         -------> deptId, year, sem is references from semester and (deptId, year, sem, div, batch) composite primary key.


Regards,

Manish Yadav

DOT. py

unread,
Jun 18, 2020, 4:53:23 PM6/18/20
to django...@googlegroups.com
Use SQL Alchemy ORM , Django ORM has foreign key policy , if u can solve it using that it's on u .. 

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/8681de2d-977e-4817-be8d-2d1e865e93a6o%40googlegroups.com.

MANISH YADAV

unread,
Jun 18, 2020, 9:56:54 PM6/18/20
to Django users
But if I use SQL Alchemy, can I use django admin panel. Because need that.
Reply all
Reply to author
Forward
0 new messages