Commit 2f2f54e4 authored by Gab De Jesus's avatar Gab De Jesus

Moved course model from reviews to prof.models

parent 7147e9cb
...@@ -6,4 +6,11 @@ class Prof(models.Model): ...@@ -6,4 +6,11 @@ class Prof(models.Model):
last_name = models.CharField(max_length = 20, unique = False) last_name = models.CharField(max_length = 20, unique = False)
def __str__ (self): def __str__ (self):
return self.first_name + self.last_name return self.first_name + " " + self.last_name
\ No newline at end of file
class Course(models.Model):
name = models.CharField(max_length = 20, unique = True)
prof = models.ManyToManyField(Prof)
def __str__ (self):
return self.name + " " + self.prof
from django.contrib import admin from django.contrib import admin
# Register your models here. # Register your models here.
from .models import Course, Review from .models import Review
admin.site.register(Course)
admin.site.register(Review) admin.site.register(Review)
\ No newline at end of file
...@@ -6,11 +6,6 @@ from django.contrib.auth.models import User ...@@ -6,11 +6,6 @@ from django.contrib.auth.models import User
from profs.models import Prof from profs.models import Prof
# Create your models here. # Create your models here.
class Course(models.Model):
name = models.CharField(max_length = 15, unique = True)
description = models.CharField(max_length = 100)
class Review(models.Model): class Review(models.Model):
message = models.TextField(max_length = 4000) message = models.TextField(max_length = 4000)
created_at = models.DateTimeField(auto_now_add = True) created_at = models.DateTimeField(auto_now_add = True)
......
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