# /personality_test/models.py
from django.db import models



# Create your models here.
class PersonType(models.Model):
	PERSON_TYPE = (
		('INTJ','INTJ'),
		('INTP','INTP'),
		('ENTJ','ENTJ'),
		('ENTP','ENTP'),
		('INFJ','INFJ'),
		('INFP','INFP'),
		('ENFJ','ENFJ'),
		('ENFP','ENFP'),
		('ISTJ','ISTJ'),
		('ISFJ','ISFJ'),
		('ESTJ','ESTJ'),
		('ESFJ','ESFJ'),
		('ISTP','ISTP'),
		('ISFP','ISFP'),
		('ESTP','ESTP'),
		('ESFP','ESFP'),
	)
	person_type = models.CharField(max_length=4, choices=PERSON_TYPE)
	#question_type = models.TextField(default=null)

	def __str__(self):
		return self.person_type

class Blog(models.Model):
    name = models.CharField(max_length=100)
    tagline = models.TextField()

    def __str__(self):              # __unicode__ on Python 2
        return self.name

class Author(models.Model):
    name = models.CharField(max_length=200)
    email = models.EmailField()

    def __str__(self):              # __unicode__ on Python 2
        return self.name

class Entry(models.Model):
    blog = models.ForeignKey(Blog)
    headline = models.CharField(max_length=255)
    body_text = models.TextField()
    pub_date = models.DateField()
    mod_date = models.DateField()
    authors = models.ManyToManyField(Author)
    n_comments = models.IntegerField()
    n_pingbacks = models.IntegerField()
    rating = models.IntegerField()

    def __str__(self):              # __unicode__ on Python 2
        return self.headline