diff --git a/db.sqlite3 b/db.sqlite3 index ce3d545..1aff276 100644 Binary files a/db.sqlite3 and b/db.sqlite3 differ diff --git a/qa/migrations/0008_answer_votes.py b/qa/migrations/0008_answer_votes.py new file mode 100644 index 0000000..c81cda9 --- /dev/null +++ b/qa/migrations/0008_answer_votes.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('qa', '0007_answer_pub_date'), + ] + + operations = [ + migrations.AddField( + model_name='answer', + name='votes', + field=models.IntegerField(default=0), + preserve_default=True, + ), + ] diff --git a/qa/migrations/0008_answer_votes.pyc b/qa/migrations/0008_answer_votes.pyc new file mode 100644 index 0000000..bcef763 Binary files /dev/null and b/qa/migrations/0008_answer_votes.pyc differ diff --git a/qa/models.py b/qa/models.py index d86598b..5357c3a 100644 --- a/qa/models.py +++ b/qa/models.py @@ -34,6 +34,7 @@ def __unicode__(self): class Answer(models.Model): question = models.ForeignKey(Question) answer_text = models.CharField(max_length=200) + votes = models.IntegerField(default=0) pub_date = models.DateTimeField('date published') user_data = models.ForeignKey(UserProfile) def __str__(self): diff --git a/qa/models.pyc b/qa/models.pyc index 633b2fc..d9a3368 100644 Binary files a/qa/models.pyc and b/qa/models.pyc differ diff --git a/qa/templates/qa/detail.html b/qa/templates/qa/detail.html index d1e3457..1c5c647 100644 --- a/qa/templates/qa/detail.html +++ b/qa/templates/qa/detail.html @@ -3,27 +3,59 @@ {% bootstrap_css %} {% bootstrap_javascript %} + + + +
{{ question.pub_date }}
+This question is still open, Write answer!