diff --git a/rad/settings.py b/rad/settings.py index a55b3bae..1fec0449 100644 --- a/rad/settings.py +++ b/rad/settings.py @@ -35,6 +35,7 @@ INSTALLED_APPS = [ 'physics', 'rapids', 'longs', + 'wally', "reversion", "django_tables2", "django_filters", diff --git a/wally/__init__.py b/wally/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/wally/admin.py b/wally/admin.py new file mode 100644 index 00000000..84245fb3 --- /dev/null +++ b/wally/admin.py @@ -0,0 +1,9 @@ +from django.contrib import admin + +from .models import Question, Response, Candidate, Specialty +# Register your models here. + +admin.site.register(Question) +admin.site.register(Response) +admin.site.register(Candidate) +admin.site.register(Specialty) \ No newline at end of file diff --git a/wally/apps.py b/wally/apps.py new file mode 100644 index 00000000..117736e0 --- /dev/null +++ b/wally/apps.py @@ -0,0 +1,5 @@ +from django.apps import AppConfig + + +class WallyConfig(AppConfig): + name = 'wally' diff --git a/wally/migrations/__init__.py b/wally/migrations/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/wally/models.py b/wally/models.py new file mode 100644 index 00000000..3344cfa5 --- /dev/null +++ b/wally/models.py @@ -0,0 +1,23 @@ +from django.db import models + + +def image_directory_path(instance, filename): + return u"wally/picture/{0}".format(filename) + +class Specialty(models.Model): + specialty = models.CharField() + +# Create your models here. +class Candidate(models.Model): + age = models.PositiveIntegerField() + specialty = models.ForeignKey(Specialty) + +class Response(models.Model): + question = models.ForeignKey("Question") + time_to_find = models.FloatField() + hit_point_x = models.FloatField() + hit_point_y = models.FloatField() + +class Question(models.Model): + image = models.ImageField(upload_to=image_directory_path) + hit_box = models.TextField() \ No newline at end of file diff --git a/wally/tests.py b/wally/tests.py new file mode 100644 index 00000000..7ce503c2 --- /dev/null +++ b/wally/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/wally/views.py b/wally/views.py new file mode 100644 index 00000000..91ea44a2 --- /dev/null +++ b/wally/views.py @@ -0,0 +1,3 @@ +from django.shortcuts import render + +# Create your views here.