Commit 75a014e1 authored by João Denis Rodrigues's avatar João Denis Rodrigues
Browse files

settings do postgres + model para guardar todos os dados

parent 309c94b1
......@@ -81,10 +81,21 @@ WSGI_APPLICATION = 'adega.wsgi.application'
# Database
# https://docs.djangoproject.com/en/1.11/ref/settings/#databases
#DATABASES = {
# 'default': {
# 'ENGINE': 'django.db.backends.sqlite3',
# 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
# }
#}
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'adega',
'USER': 'adega',
'PASSWORD': '123456',
'HOST': 'localhost',
'PORT': '',
}
}
......
......@@ -26,6 +26,19 @@ class CourseCurriculum(models.Model):
period = models.PositiveIntegerField(null = True)
type_course = models.CharField(max_length = 255)
class HistoryData(models.Model):
degree = models.ForeignKey(Degree)
student = models.ForeignKey(Student)
year = models.PositiveIntegerField(null = True, blank = True)
semester = models.PositiveIntegerField(null = True, blank = True)
situation = models.CharField(max_length=255)
letter = models.CharField(max_length=2)
course_code = models.CharField(max_length=5)
credits = models.PositiveIntegerField()
course_type = models.CharField(max_length=255)
frequency = models.FloatField()
#course = models.ForeignKey(Course)
class CourseCurriculumMongo(Document):
start_year = fields.IntField()
......
......@@ -14,6 +14,7 @@ class Student(models.Model):
evasion_semester = models.PositiveIntegerField(null = True, blank = True)
current_curriculum = models.ForeignKey(Curriculum)
admission = models.ForeignKey(Admission)
admission_form = models.CharField(max_length=255)
klasses = models.ManyToManyField('klass.Klass', through = 'klass.StudentKlass')
def get_time_in_degree(self):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment