Skip to content

Commit

Permalink
ran pep8 in everything
Browse files Browse the repository at this point in the history
  • Loading branch information
santagada committed Aug 24, 2013
1 parent c0ed0fc commit d771089
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 23 deletions.
4 changes: 3 additions & 1 deletion course/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,17 @@
admin.site.register(Video)
admin.site.register(CourseProfessor)


class LessonInline(SortableTabularInline):
model = Lesson
sortable = 'position'


class CourseAdmin(ModelAdmin):
inlines = (LessonInline,)

admin.site.register(Course, CourseAdmin)
admin.site.register(Lesson)
admin.site.register(Activity)
admin.site.register(Unit)
admin.site.register(Answer)
admin.site.register(Answer)
8 changes: 7 additions & 1 deletion course/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from django.contrib.auth.models import AbstractUser
from django.template.defaultfilters import slugify


class TimtecUser(AbstractUser):
pass

Expand All @@ -14,6 +15,7 @@ class Video(models.Model):
def __unicode__(self):
return self.name


class Course(models.Model):
STATES = (
('new', 'New'),
Expand All @@ -37,6 +39,7 @@ class Course(models.Model):
def __unicode__(self):
return self.name


class CourseProfessor(models.Model):
class Meta:
unique_together = (('user', 'course'),)
Expand All @@ -46,7 +49,7 @@ class Meta:
biography = models.TextField()

def __unicode__(self):
return unicode(self.user) + ' @ ' + unicode(self.course)
return u'%s @ %s' % (self.user, self.course)


class Lesson(models.Model):
Expand All @@ -67,6 +70,7 @@ def save(self, **kwargs):
def __unicode__(self):
return self.name


class Activity(models.Model):
"""
Generic class to activities
Expand All @@ -90,6 +94,7 @@ class Meta:
def __unicode__(self):
return u'%s dt %s a %s' % (self.type, self.data, self.expected_answer)


class Unit(models.Model):
lesson = models.ForeignKey(Lesson)
video = models.ForeignKey(Video, null=True, blank=True)
Expand All @@ -102,6 +107,7 @@ class Meta:
def __unicode__(self):
return u'%s) %s - %s - %s' % (self.position, self.lesson, self.video, self.activity)


class Answer(models.Model):
activity = models.ForeignKey(Activity)
user = models.ForeignKey(TimtecUser)
Expand Down
16 changes: 0 additions & 16 deletions course/tests.py

This file was deleted.

1 change: 1 addition & 0 deletions tests/test_models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import pytest
from course.models import *


@pytest.mark.django_db
def test_super_user():
a = TimtecUser.objects.get(username='a')
Expand Down
8 changes: 4 additions & 4 deletions timtec/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'timtec.sqlite', # Or path to database file if using sqlite3.
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'timtec.sqlite', # Or path to database file if using sqlite3.
# The following settings are not used with sqlite3:
'USER': '',
'PASSWORD': '',
Expand Down Expand Up @@ -79,7 +79,7 @@
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
# 'django.contrib.staticfiles.finders.DefaultStorageFinder',
# 'django.contrib.staticfiles.finders.DefaultStorageFinder',
)

# Make this unique, and don't share it with anybody.
Expand All @@ -89,7 +89,7 @@
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
# 'django.template.loaders.eggs.Loader',
# 'django.template.loaders.eggs.Loader',
)

from django.conf.global_settings import TEMPLATE_CONTEXT_PROCESSORS as TCP
Expand Down
3 changes: 2 additions & 1 deletion timtec/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
urlpatterns = patterns(
'',
# Examples:
# url(r'^$', 'timtec.views.home', name='home'),
# url(r'^timtec/', include('timtec.foo.urls')),
Expand Down

0 comments on commit d771089

Please sign in to comment.