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(max_length=200)

# Create your models here.
class Candidate(models.Model):
    age = models.PositiveIntegerField()
    specialty = models.ForeignKey(Specialty, on_delete=models.SET_NULL, null=True, blank=True)

class Response(models.Model):
    question = models.ForeignKey("Question", on_delete=models.SET_NULL, null=True, blank=True)
    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()