diff --git a/backend/RateMyCourse/__pycache__/__init__.cpython-36.pyc b/backend/RateMyCourse/__pycache__/__init__.cpython-36.pyc index a574410..5322945 100644 Binary files a/backend/RateMyCourse/__pycache__/__init__.cpython-36.pyc and b/backend/RateMyCourse/__pycache__/__init__.cpython-36.pyc differ diff --git a/backend/RateMyCourse/__pycache__/settings.cpython-36.pyc b/backend/RateMyCourse/__pycache__/settings.cpython-36.pyc index 8e7d0e8..34c9e7c 100644 Binary files a/backend/RateMyCourse/__pycache__/settings.cpython-36.pyc and b/backend/RateMyCourse/__pycache__/settings.cpython-36.pyc differ diff --git a/backend/RateMyCourse/__pycache__/urls.cpython-36.pyc b/backend/RateMyCourse/__pycache__/urls.cpython-36.pyc index 1caf096..0a0e5da 100644 Binary files a/backend/RateMyCourse/__pycache__/urls.cpython-36.pyc and b/backend/RateMyCourse/__pycache__/urls.cpython-36.pyc differ diff --git a/backend/RateMyCourse/__pycache__/wsgi.cpython-36.pyc b/backend/RateMyCourse/__pycache__/wsgi.cpython-36.pyc index ebe18f9..5bc6592 100644 Binary files a/backend/RateMyCourse/__pycache__/wsgi.cpython-36.pyc and b/backend/RateMyCourse/__pycache__/wsgi.cpython-36.pyc differ diff --git a/backend/db.sqlite3 b/backend/db.sqlite3 index 3e92540..8069708 100644 Binary files a/backend/db.sqlite3 and b/backend/db.sqlite3 differ diff --git a/backend/postings/__pycache__/__init__.cpython-36.pyc b/backend/postings/__pycache__/__init__.cpython-36.pyc index 0e233cf..cdaf68f 100644 Binary files a/backend/postings/__pycache__/__init__.cpython-36.pyc and b/backend/postings/__pycache__/__init__.cpython-36.pyc differ diff --git a/backend/postings/__pycache__/admin.cpython-36.pyc b/backend/postings/__pycache__/admin.cpython-36.pyc index 358d84f..3e6cf9c 100644 Binary files a/backend/postings/__pycache__/admin.cpython-36.pyc and b/backend/postings/__pycache__/admin.cpython-36.pyc differ diff --git a/backend/postings/__pycache__/models.cpython-36.pyc b/backend/postings/__pycache__/models.cpython-36.pyc index 4631b3f..ed96cbb 100644 Binary files a/backend/postings/__pycache__/models.cpython-36.pyc and b/backend/postings/__pycache__/models.cpython-36.pyc differ diff --git a/backend/postings/api/__pycache__/__init__.cpython-36.pyc b/backend/postings/api/__pycache__/__init__.cpython-36.pyc index 9bff942..bcfb9f6 100644 Binary files a/backend/postings/api/__pycache__/__init__.cpython-36.pyc and b/backend/postings/api/__pycache__/__init__.cpython-36.pyc differ diff --git a/backend/postings/api/__pycache__/serializers.cpython-36.pyc b/backend/postings/api/__pycache__/serializers.cpython-36.pyc index 201319d..91e9be5 100644 Binary files a/backend/postings/api/__pycache__/serializers.cpython-36.pyc and b/backend/postings/api/__pycache__/serializers.cpython-36.pyc differ diff --git a/backend/postings/api/__pycache__/urls.cpython-36.pyc b/backend/postings/api/__pycache__/urls.cpython-36.pyc index 2991bc1..eb6b697 100644 Binary files a/backend/postings/api/__pycache__/urls.cpython-36.pyc and b/backend/postings/api/__pycache__/urls.cpython-36.pyc differ diff --git a/backend/postings/api/__pycache__/views.cpython-36.pyc b/backend/postings/api/__pycache__/views.cpython-36.pyc index f7b96d3..595466e 100644 Binary files a/backend/postings/api/__pycache__/views.cpython-36.pyc and b/backend/postings/api/__pycache__/views.cpython-36.pyc differ diff --git a/backend/postings/api/serializers.py b/backend/postings/api/serializers.py index c129084..0ac49dd 100644 --- a/backend/postings/api/serializers.py +++ b/backend/postings/api/serializers.py @@ -8,6 +8,7 @@ class UniversityReviewSerializer(serializers.ModelSerializer): fields = [ 'pk', 'university_name', + 'rating', 'title', 'username', 'date_published', @@ -15,5 +16,4 @@ class UniversityReviewSerializer(serializers.ModelSerializer): ] read_only_fields =[ 'pk', - 'username' ] \ No newline at end of file diff --git a/backend/postings/migrations/0004_auto_20180926_1312.py b/backend/postings/migrations/0004_auto_20180926_1312.py new file mode 100644 index 0000000..77e23cf --- /dev/null +++ b/backend/postings/migrations/0004_auto_20180926_1312.py @@ -0,0 +1,86 @@ +# Generated by Django 2.0.6 on 2018-09-26 11:12 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('postings', '0003_universityreview_title'), + ] + + operations = [ + migrations.CreateModel( + name='RateableEntity', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=256)), + ], + ), + migrations.CreateModel( + name='Review', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('rating', models.IntegerField(default=1)), + ('title', models.CharField(max_length=128)), + ('content', models.TextField()), + ('created_date', models.DateTimeField(auto_now_add=True)), + ('last_updated_date', models.DateTimeField(auto_now=True)), + ], + ), + migrations.CreateModel( + name='ReviewHelpfulVote', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('helpful', models.BooleanField()), + ('review', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='postings.Review')), + ], + ), + migrations.AddField( + model_name='universityreview', + name='rating', + field=models.IntegerField(default=1), + ), + migrations.CreateModel( + name='Course', + fields=[ + ('rateableentity_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='postings.RateableEntity')), + ], + bases=('postings.rateableentity',), + ), + migrations.CreateModel( + name='Professor', + fields=[ + ('rateableentity_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='postings.RateableEntity')), + ], + bases=('postings.rateableentity',), + ), + migrations.CreateModel( + name='University', + fields=[ + ('rateableentity_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='postings.RateableEntity')), + ], + bases=('postings.rateableentity',), + ), + migrations.AddField( + model_name='review', + name='rateable_entity', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='postings.RateableEntity'), + ), + migrations.AddField( + model_name='professor', + name='university', + field=models.ManyToManyField(to='postings.University'), + ), + migrations.AddField( + model_name='course', + name='professors', + field=models.ManyToManyField(to='postings.Professor'), + ), + migrations.AddField( + model_name='course', + name='taught_at_university', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='postings.University'), + ), + ] diff --git a/backend/postings/migrations/__pycache__/0001_initial.cpython-36.pyc b/backend/postings/migrations/__pycache__/0001_initial.cpython-36.pyc index 9cf0b28..ee47a95 100644 Binary files a/backend/postings/migrations/__pycache__/0001_initial.cpython-36.pyc and b/backend/postings/migrations/__pycache__/0001_initial.cpython-36.pyc differ diff --git a/backend/postings/migrations/__pycache__/0002_auto_20180916_1536.cpython-36.pyc b/backend/postings/migrations/__pycache__/0002_auto_20180916_1536.cpython-36.pyc index f2e4599..d8befd8 100644 Binary files a/backend/postings/migrations/__pycache__/0002_auto_20180916_1536.cpython-36.pyc and b/backend/postings/migrations/__pycache__/0002_auto_20180916_1536.cpython-36.pyc differ diff --git a/backend/postings/migrations/__pycache__/0003_universityreview_title.cpython-36.pyc b/backend/postings/migrations/__pycache__/0003_universityreview_title.cpython-36.pyc index fb98ec2..7295b5f 100644 Binary files a/backend/postings/migrations/__pycache__/0003_universityreview_title.cpython-36.pyc and b/backend/postings/migrations/__pycache__/0003_universityreview_title.cpython-36.pyc differ diff --git a/backend/postings/migrations/__pycache__/__init__.cpython-36.pyc b/backend/postings/migrations/__pycache__/__init__.cpython-36.pyc index a21ad51..722cbe5 100644 Binary files a/backend/postings/migrations/__pycache__/__init__.cpython-36.pyc and b/backend/postings/migrations/__pycache__/__init__.cpython-36.pyc differ diff --git a/backend/postings/models.py b/backend/postings/models.py index bc1038a..2384882 100644 --- a/backend/postings/models.py +++ b/backend/postings/models.py @@ -48,6 +48,7 @@ class Course(RateableEntity): class UniversityReview(models.Model): university_name = models.CharField(max_length=200) username = models.CharField(max_length=200) + rating = models.IntegerField(default=1) title = models.CharField(max_length=200) date_published = models.DateTimeField('date published') content = models.CharField(max_length=200)