Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Create your models here.
- # Python code to demonstrate SQL to fetch data.
- # importing the module
- import sqlite3
- from django.db import models
- class AdditionalEntranceExaminations(models.Model):
- additional_entrance_examinations_key = models.IntegerField(primary_key=True)
- department_key = models.ForeignKey('DepartmentMain', models.DO_NOTHING, db_column='department_key')
- subject = models.ForeignKey('Subject', models.DO_NOTHING)
- student = models.ForeignKey('Student', models.DO_NOTHING)
- date = models.DateField(blank=True, null=True)
- goals = models.IntegerField(blank=True, null=True)
- result = models.IntegerField(blank=True, null=True)
- is_active = models.IntegerField(blank=True, null=True)
- class Meta:
- managed = False
- db_table = 'additional_entrance_examinations'
- class AuthGroup(models.Model):
- name = models.CharField(unique=True, max_length=150)
- class Meta:
- managed = False
- db_table = 'auth_group'
- class AuthGroupPermissions(models.Model):
- id = models.BigAutoField(primary_key=True)
- group = models.ForeignKey(AuthGroup, models.DO_NOTHING)
- permission = models.ForeignKey('AuthPermission', models.DO_NOTHING)
- class Meta:
- managed = False
- db_table = 'auth_group_permissions'
- unique_together = (('group', 'permission'),)
- class AuthPermission(models.Model):
- name = models.CharField(max_length=255)
- content_type = models.ForeignKey('DjangoContentType', models.DO_NOTHING)
- codename = models.CharField(max_length=100)
- class Meta:
- managed = False
- db_table = 'auth_permission'
- unique_together = (('content_type', 'codename'),)
- class AuthUser(models.Model):
- password = models.CharField(max_length=128)
- last_login = models.DateTimeField(blank=True, null=True)
- is_superuser = models.IntegerField()
- username = models.CharField(unique=True, max_length=150)
- first_name = models.CharField(max_length=150)
- last_name = models.CharField(max_length=150)
- email = models.CharField(max_length=254)
- is_staff = models.IntegerField()
- is_active = models.IntegerField()
- date_joined = models.DateTimeField()
- class Meta:
- managed = False
- db_table = 'auth_user'
- class AuthUserGroups(models.Model):
- id = models.BigAutoField(primary_key=True)
- user = models.ForeignKey(AuthUser, models.DO_NOTHING)
- group = models.ForeignKey(AuthGroup, models.DO_NOTHING)
- class Meta:
- managed = False
- db_table = 'auth_user_groups'
- unique_together = (('user', 'group'),)
- class AuthUserUserPermissions(models.Model):
- id = models.BigAutoField(primary_key=True)
- user = models.ForeignKey(AuthUser, models.DO_NOTHING)
- permission = models.ForeignKey(AuthPermission, models.DO_NOTHING)
- class Meta:
- managed = False
- db_table = 'auth_user_user_permissions'
- unique_together = (('user', 'permission'),)
- class Competitions(models.Model):
- competition_id = models.IntegerField(primary_key=True)
- name = models.TextField(blank=True, null=True)
- url = models.TextField(blank=True, null=True)
- class Meta:
- managed = False
- db_table = 'competitions'
- class Department(models.Model):
- department_id = models.IntegerField(primary_key=True)
- department_name = models.TextField(blank=True, null=True)
- info = models.TextField(blank=True, null=True)
- class Meta:
- managed = False
- db_table = 'department'
- class DepartmentMain(models.Model):
- key = models.IntegerField(primary_key=True)
- department = models.ForeignKey(Department, models.DO_NOTHING)
- faculty = models.ForeignKey('Faculty', models.DO_NOTHING)
- recommendation = models.TextField(blank=True, null=True)
- info = models.TextField(blank=True, null=True)
- class Meta:
- managed = False
- db_table = 'department_main'
- class DjangoAdminLog(models.Model):
- action_time = models.DateTimeField()
- object_id = models.TextField(blank=True, null=True)
- object_repr = models.CharField(max_length=200)
- action_flag = models.PositiveSmallIntegerField()
- change_message = models.TextField()
- content_type = models.ForeignKey('DjangoContentType', models.DO_NOTHING, blank=True, null=True)
- user = models.ForeignKey(AuthUser, models.DO_NOTHING)
- class Meta:
- managed = False
- db_table = 'django_admin_log'
- managed = False
- db_table = 'django_migrations'
- session_data = models.TextField()
- expire_date = models.DateTimeField()
- class Meta:
- managed = False
- db_table = 'django_session'
- class Faculty(models.Model):
- faculty_id = models.IntegerField(primary_key=True)
- faculty = models.TextField(blank=True, null=True)
- university = models.ForeignKey('University', models.DO_NOTHING)
- class Meta:
- managed = False
- db_table = 'faculty'
- class Level(models.Model):
- level_id = models.IntegerField(primary_key=True)
- level = models.IntegerField()
- class Meta:
- managed = False
- db_table = 'level'
- class MainOlympiads(models.Model):
- olympiad_id = models.IntegerField(primary_key=True)
- level = models.ForeignKey(Level, models.DO_NOTHING, blank=True, null=True)
- competition = models.ForeignKey(Competitions, models.DO_NOTHING)
- subject = models.ForeignKey('Subject', models.DO_NOTHING)
- year = models.ForeignKey('Year', models.DO_NOTHING)
- number = models.IntegerField()
- class Meta:
- managed = False
- db_table = 'main_olympiads'
- class OlympiadResultKeys(models.Model):
- grade = models.IntegerField(blank=True, null=True)
- is_winner = models.IntegerField()
- is_prize_winner = models.IntegerField()
- class Meta:
- managed = False
- db_table = 'olympiad_result_keys'
- class OlympiadsChosen(models.Model):
- olympiads_chosen_key = models.IntegerField(primary_key=True)
- olympiads = models.ForeignKey(MainOlympiads, models.DO_NOTHING)
- student = models.ForeignKey('Student', models.DO_NOTHING)
- date = models.DateField()
- goals = models.ForeignKey(OlympiadResultKeys, models.DO_NOTHING, db_column='goals')
- result = models.ForeignKey(OlympiadResultKeys, models.DO_NOTHING, db_column='result')
- is_active = models.IntegerField(blank=True, null=True)
- class Meta:
- managed = False
- db_table = 'olympiads_chosen'
- class Student(models.Model):
- student_id = models.IntegerField(primary_key=True)
- name = models.TextField(blank=True, null=True)
- grade = models.IntegerField(blank=True, null=True)
- class Meta:
- managed = False
- db_table = 'student'
- class Subject(models.Model):
- subject_id = models.IntegerField(primary_key=True)
- subject = models.TextField(blank=True, null=True)
- class Meta:
- managed = False
- db_table = 'subject'
- class University(models.Model):
- university_id = models.IntegerField(primary_key=True)
- university = models.TextField(blank=True, null=True)
- url = models.TextField(blank=True, null=True)
- class Meta:
- managed = False
- db_table = 'university'
- class UniversityChosen(models.Model):
- university_chosen_key = models.IntegerField(primary_key=True)
- date = models.DateField()
- student = models.ForeignKey(Student, models.DO_NOTHING)
- department_key = models.ForeignKey(DepartmentMain, models.DO_NOTHING, db_column='department_key')
- extra_points = models.IntegerField(blank=True, null=True)
- is_active = models.IntegerField(blank=True, null=True)
- class Meta:
- managed = False
- db_table = 'university_chosen'
- class Use(models.Model):
- use_key = models.IntegerField(db_column='USE_key', primary_key=True) # Field name made lowercase.
- subject = models.ForeignKey(Subject, models.DO_NOTHING)
- subject_coefficient = models.IntegerField(blank=True, null=True)
- student = models.ForeignKey(Student, models.DO_NOTHING)
- date = models.DateField(blank=True, null=True)
- goals = models.IntegerField(blank=True, null=True)
- result = models.IntegerField(blank=True, null=True)
- is_active = models.IntegerField(blank=True, null=True)
- class Meta:
- managed = False
- db_table = 'use'
- class Vsosh(models.Model):
- vsosh_id = models.IntegerField(primary_key=True)
- subject = models.ForeignKey(Subject, models.DO_NOTHING)
- student = models.ForeignKey(Student, models.DO_NOTHING)
- date = models.DateField()
- goals = models.ForeignKey(OlympiadResultKeys, models.DO_NOTHING, db_column='goals')
- result = models.ForeignKey(OlympiadResultKeys, models.DO_NOTHING, db_column='result')
- is_active = models.IntegerField(blank=True, null=True)
- class Meta:
- managed = False
- db_table = 'vsosh'
- class Year(models.Model):
- year_id = models.IntegerField(primary_key=True)
- year = models.TextField(blank=True, null=True)
- class Meta:
- managed = False
- db_table = 'year'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement