Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alan D6 kind of finished #4

Open
wants to merge 52 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
3cd5198
initial commit
AlanCoding Jun 14, 2015
9275155
initial commit
AlanCoding Jun 14, 2015
051e19c
added procfile
AlanCoding Jun 14, 2015
9440ff7
added procfile
AlanCoding Jun 14, 2015
4842cab
added runtime.txt
AlanCoding Jun 15, 2015
8cbc1f9
added runtime.txt
AlanCoding Jun 15, 2015
15725cb
changed Procfile to point to movies
AlanCoding Jun 15, 2015
83a8e6b
changed Procfile to point to movies
AlanCoding Jun 15, 2015
094f3bd
production fixes
AlanCoding Jun 15, 2015
2545d37
production fixes
AlanCoding Jun 15, 2015
290516b
at last get rid of the darn top 20 list
AlanCoding Jun 15, 2015
76d46ab
at last get rid of the darn top 20 list
AlanCoding Jun 15, 2015
6e566f9
nuke repo with production version
AlanCoding Jun 15, 2015
69faca5
nuke repo with production version
AlanCoding Jun 15, 2015
9d98b03
DB file removed at long last
AlanCoding Jun 15, 2015
06d4876
DB file removed at long last
AlanCoding Jun 15, 2015
6a1eb70
middle of big db changes
AlanCoding Jun 15, 2015
865f938
middle of big db changes
AlanCoding Jun 15, 2015
a6851c6
get json files on gitignore
AlanCoding Jun 15, 2015
d729593
most functionality requirements
AlanCoding Jun 16, 2015
0f6af59
removed json files properly
AlanCoding Jun 16, 2015
5e25181
fixed conflict after history change because of big file oops
AlanCoding Jun 16, 2015
afe5e2e
edit review works
AlanCoding Jun 16, 2015
2d6286a
user dashboard working except for delete review
AlanCoding Jun 16, 2015
f9ff893
delete rating works
AlanCoding Jun 16, 2015
e314d61
loading bootstraps
AlanCoding Jun 16, 2015
af4c264
bootstraps basic functionality
AlanCoding Jun 16, 2015
15ace8a
get rid of virtual env files
AlanCoding Jun 16, 2015
55ab0d0
remove more junk files from repo
AlanCoding Jun 16, 2015
e433e5c
lots of asthetic improvements
AlanCoding Jun 16, 2015
9837372
working using progreSQL DB
AlanCoding Jun 17, 2015
1ca6691
replaced all lists with bootstrap tables
AlanCoding Jun 17, 2015
0ca3822
commit progress bar before merge attempt
AlanCoding Jun 17, 2015
000c110
more before merge
AlanCoding Jun 17, 2015
335aaf3
merge should be complete
AlanCoding Jun 17, 2015
8c87527
prepare files for 2nd try
AlanCoding Jun 17, 2015
eeb1757
merge, hopefully done right this time
AlanCoding Jun 17, 2015
83e0696
404 file work, production mode
AlanCoding Jun 17, 2015
0038347
added movie rating over time plots
AlanCoding Jun 17, 2015
650d1b8
caching for top 20 working, start of class views
AlanCoding Jun 17, 2015
a0208c8
top 20 paginated version working well
AlanCoding Jun 17, 2015
522be35
hard won victory - figured out pagination for genre
AlanCoding Jun 18, 2015
57c2fc1
user page paginated
AlanCoding Jun 18, 2015
8fcf618
last changes specific to class
AlanCoding Jun 18, 2015
969d571
static files needed for heroku
AlanCoding Jun 18, 2015
acb24a3
include more static directories
AlanCoding Jun 18, 2015
4d443f7
small additions
AlanCoding Jun 18, 2015
0a9fa9d
settings for hiroku and foreman together
AlanCoding Jun 18, 2015
f00f68f
hard code heroku db
AlanCoding Jun 18, 2015
9425c86
databases dictionary error
AlanCoding Jun 18, 2015
ede69f4
extreme duplication of static directories
AlanCoding Jun 18, 2015
e6b3de9
collect changes from heroku for github
AlanCoding Jun 22, 2015
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .Python
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
layout python3
27 changes: 27 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
venv/
# Created by https://www.gitignore.io

### Python ###
Expand Down Expand Up @@ -60,5 +61,31 @@ docs/_build/
target/

data/
ml-1m/
.DS_Store
.direnv/
movieratings/fixtures/

*.sqlite
*.sqlite3
*.sqlite3.old
db.sqlite3

fixtures/*
*.pyc
**/*.pyc
**/*.*.pyc
**/*.*.*.pyc
/**/*.pyc
Rater/__pycache__/models.cpython-34.pyc
.DS_Store
Rater/__pycache__/*
*/__pycache__/


movieratings/__pycache__/
lib/
Rater/__pycache__/
*.zip
*.sqlite
*.sqlite3
1 change: 1 addition & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: gunicorn movieratings.wsgi --log-file -
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@

Create an interface in Django to the [MovieLens dataset][movielens].

## File Structure

The Rater class was created as its own app, with most of the files there.
The top-level is movingratings, which is on a different level from the
original repository.

A live version on heroku can be found at:

https://nameless-mountain-9760.herokuapp.com/index.html


## Learning Objectives

After completing this assignment, you should be able to:
Expand Down
File renamed without changes.
17 changes: 17 additions & 0 deletions Rater/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from django.contrib import admin
from .models import Movie, Rating, Rater


class MovieAdmin(admin.ModelAdmin):
list_display = ['__str__', 'release_date', 'total_ratings', "avg_rating"]

class RatingAdmin(admin.ModelAdmin):
list_display = ['__str__', 'rating']

class RaterAdmin(admin.ModelAdmin):
list_display = ['__str__', 'age', 'gender', 'rating_count']

# Register your models here.
admin.site.register(Movie, MovieAdmin)
admin.site.register(Rater, RaterAdmin)
admin.site.register(Rating, RatingAdmin)
26 changes: 26 additions & 0 deletions Rater/forms.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
from django import forms
from django.contrib.auth.models import User
from Rater.models import Rater, Rating
# Profile

class UserForm(forms.ModelForm):
password = forms.CharField(widget=forms.PasswordInput())

class Meta:
model = User
fields = ('username', 'email', 'password',)

class RaterForm(forms.ModelForm):
class Meta:
model = Rater
fields = ('age', 'gender', 'occupation', 'zip_code',)

class RatingForm(forms.ModelForm):
class Meta:
model = Rating
fields = ('rating', 'review',)

class LoginForm(forms.ModelForm):
class Meta:
model = User
fields = ('username', 'password')
52 changes: 52 additions & 0 deletions Rater/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations
from django.conf import settings


class Migration(migrations.Migration):

dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]

operations = [
migrations.CreateModel(
name='Genre',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('text', models.CharField(default='', max_length=300)),
],
),
migrations.CreateModel(
name='Movie',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('title', models.CharField(default='unknown', max_length=200)),
('release_date', models.IntegerField(default=1990)),
('genre', models.ManyToManyField(to='Rater.Genre')),
],
),
migrations.CreateModel(
name='Rater',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('age', models.IntegerField(default=0)),
('gender', models.CharField(default='M', max_length=1, choices=[('M', 'Male'), ('F', 'Female')])),
('occupation', models.IntegerField(default=0, choices=[(0, 'other'), (1, 'academic/educator'), (2, 'artist'), (3, 'clerical/admin'), (4, 'college/grad student'), (5, 'customer service'), (6, 'doctor/health care'), (7, 'executive/managerial'), (8, 'farmer'), (9, 'homemaker'), (10, 'K-12 student'), (11, 'lawyer'), (12, 'programmer'), (13, 'retired'), (14, 'sales/marketing'), (15, 'scientist'), (16, 'self-employed'), (17, 'technician/engineer'), (18, 'tradesman/craftsman'), (19, 'unemployed'), (20, 'writer')])),
('zip_code', models.CharField(default='00000', max_length=10)),
('user', models.OneToOneField(to=settings.AUTH_USER_MODEL, null=True)),
],
),
migrations.CreateModel(
name='Rating',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('posted', models.IntegerField(default=0)),
('rating', models.IntegerField(default=1, choices=[(1, '*'), (2, '**'), (3, '***'), (4, '****'), (5, '*****')])),
('movie', models.ForeignKey(default=1, to='Rater.Movie')),
('rater', models.ForeignKey(default=1, to='Rater.Rater')),
],
),
]
24 changes: 24 additions & 0 deletions Rater/migrations/0002_auto_20150615_2021.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations


class Migration(migrations.Migration):

dependencies = [
('Rater', '0001_initial'),
]

operations = [
migrations.AddField(
model_name='rating',
name='review',
field=models.TextField(null=True),
),
migrations.AlterField(
model_name='rater',
name='occupation',
field=models.IntegerField(choices=[(0, 'other'), (1, 'academic/educator'), (2, 'artist'), (3, 'clerical/admin'), (4, 'college/grad student'), (5, 'customer service'), (6, 'doctor/health care'), (7, 'executive/managerial'), (8, 'farmer'), (9, 'homemaker'), (10, 'K-12 student'), (11, 'lawyer'), (12, 'programmer'), (13, 'retired'), (14, 'sales/marketing'), (15, 'scientist'), (16, 'self-employed'), (17, 'technician/engineer'), (18, 'tradesman/craftsman'), (19, 'unemployed'), (20, 'writer')]),
),
]
19 changes: 19 additions & 0 deletions Rater/migrations/0003_auto_20150615_2023.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations


class Migration(migrations.Migration):

dependencies = [
('Rater', '0002_auto_20150615_2021'),
]

operations = [
migrations.AlterField(
model_name='rater',
name='zip_code',
field=models.CharField(max_length=10),
),
]
19 changes: 19 additions & 0 deletions Rater/migrations/0004_movie_avg_save.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations


class Migration(migrations.Migration):

dependencies = [
('Rater', '0003_auto_20150615_2023'),
]

operations = [
migrations.AddField(
model_name='movie',
name='avg_save',
field=models.FloatField(null=True),
),
]
24 changes: 24 additions & 0 deletions Rater/migrations/0005_auto_20150617_2019.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations


class Migration(migrations.Migration):

dependencies = [
('Rater', '0004_movie_avg_save'),
]

operations = [
migrations.AddField(
model_name='genre',
name='Nmovies_save',
field=models.IntegerField(null=True),
),
migrations.AddField(
model_name='genre',
name='Nratings_save',
field=models.IntegerField(null=True),
),
]
19 changes: 19 additions & 0 deletions Rater/migrations/0006_movie_total_save.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations


class Migration(migrations.Migration):

dependencies = [
('Rater', '0005_auto_20150617_2019'),
]

operations = [
migrations.AddField(
model_name='movie',
name='total_save',
field=models.IntegerField(null=True),
),
]
Empty file added Rater/migrations/__init__.py
Empty file.
Loading