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