diff --git a/README.rst b/README.rst index d0d1aa0..5d7f448 100644 --- a/README.rst +++ b/README.rst @@ -10,7 +10,7 @@ Quick start 1. pip install:: - pip install https://github.com/rabbit463/django-easy-faq/blob/master/dist/django-easy-faq-0.4.tar.gz?raw=true + pip install https://github.com/rabbit463/django-easy-faq/blob/master/dist/django-easy-faq-0.5.tar.gz?raw=true 1. Add "easy-faq" to your INSTALLED_APPS setting like this:: @@ -287,4 +287,5 @@ Template Variables change log ---------- -0.4 fixed bug that logged out users can vote - which then raises exceptions \ No newline at end of file +0.4 fixed bug that logged out users can vote - which then raises exceptions +0.5 fixed migrations \ No newline at end of file diff --git a/dist/django-easy-faq-0.5.tar.gz b/dist/django-easy-faq-0.5.tar.gz new file mode 100644 index 0000000..1509d97 Binary files /dev/null and b/dist/django-easy-faq-0.5.tar.gz differ diff --git a/django_easy_faq.egg-info/PKG-INFO b/django_easy_faq.egg-info/PKG-INFO index 23024c7..5b4c211 100644 --- a/django_easy_faq.egg-info/PKG-INFO +++ b/django_easy_faq.egg-info/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: django-easy-faq -Version: 0.4 +Version: 0.5 Summary: A Django app to add great faq functionality to website. Home-page: UNKNOWN Author: UNKNOWN @@ -18,7 +18,7 @@ Description: ======== 1. pip install:: - pip install https://github.com/rabbit463/django-easy-faq/blob/master/dist/django-easy-faq-0.4.tar.gz?raw=true + pip install https://github.com/rabbit463/django-easy-faq/blob/master/dist/django-easy-faq-0.5.tar.gz?raw=true 1. Add "easy-faq" to your INSTALLED_APPS setting like this:: @@ -92,7 +92,7 @@ Description: ======== {% endfor %} - 2. categories_detail.html - faq category detail view if using categories:: + 2. category_detail.html - faq category detail view if using categories::

choose a FAQ Question

{{category}}

@@ -296,6 +296,7 @@ Description: ======== change log ---------- 0.4 fixed bug that logged out users can vote - which then raises exceptions + 0.5 fixed migrations Platform: UNKNOWN Classifier: Environment :: Web Environment Classifier: Framework :: Django diff --git a/django_easy_faq.egg-info/SOURCES.txt b/django_easy_faq.egg-info/SOURCES.txt index 176f803..9bf5361 100644 --- a/django_easy_faq.egg-info/SOURCES.txt +++ b/django_easy_faq.egg-info/SOURCES.txt @@ -15,6 +15,8 @@ faq/snippets.py faq/tests.py faq/urls.py faq/views.py +faq/migrations/0001_initial.py +faq/migrations/__init__.py faq/templates/faq/answer_form.html faq/templates/faq/categories_list.html faq/templates/faq/category_detail.html diff --git a/faq/migrations/0001_initial.py b/faq/migrations/0001_initial.py new file mode 100644 index 0000000..a18a8ea --- /dev/null +++ b/faq/migrations/0001_initial.py @@ -0,0 +1,96 @@ +# Generated by Django 3.1.7 on 2021-02-28 16:07 + +from django.conf import settings +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] + + operations = [ + migrations.CreateModel( + name='Answer', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('answer', models.TextField()), + ('slug', models.SlugField(max_length=10)), + ('helpful', models.IntegerField(default=0)), + ('not_helpful', models.IntegerField(default=0)), + ], + ), + migrations.CreateModel( + name='Category', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=50, unique=True)), + ('description', models.TextField()), + ('slug', models.SlugField(unique=True)), + ], + options={ + 'verbose_name_plural': 'categories', + }, + ), + migrations.CreateModel( + name='Question', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('question', models.CharField(max_length=150, unique=True)), + ('slug', models.SlugField(max_length=150, unique=True)), + ('helpful', models.IntegerField(default=0)), + ('not_helpful', models.IntegerField(default=0)), + ('category', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='faq.category')), + ], + ), + migrations.CreateModel( + name='QuestionHelpful', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('vote', models.BooleanField()), + ('question', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='faq.question')), + ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), + ], + options={ + 'ordering': ['question', 'vote'], + }, + ), + migrations.CreateModel( + name='FAQComment', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('comment', models.TextField()), + ('post_time', models.DateTimeField(auto_now_add=True)), + ('question', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='faq.question')), + ('user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), + ], + options={ + 'ordering': ['question', '-post_time'], + }, + ), + migrations.CreateModel( + name='AnswerHelpful', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('vote', models.BooleanField()), + ('answer', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='faq.answer')), + ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), + ], + options={ + 'ordering': ['answer', 'vote'], + }, + ), + migrations.AddField( + model_name='answer', + name='question', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='faq.question'), + ), + migrations.AlterOrderWithRespectTo( + name='answer', + order_with_respect_to='question', + ), + ] diff --git a/faq/migrations/__init__.py b/faq/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/faq/models.py b/faq/models.py index a845ba1..d7a38fa 100644 --- a/faq/models.py +++ b/faq/models.py @@ -49,6 +49,8 @@ def get_not_helpful(self): def __str__(self): return self.answer + class Meta: + order_with_respect_to = 'question' def save(self,*args,**kwargs): # if first time saving add a new slug diff --git a/setup.cfg b/setup.cfg index 9d2a6d7..2c4b829 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = django-easy-faq -version = 0.4 +version = 0.5 description = A Django app to add great faq functionality to website. long_description = file: README.rst license = BSD-3-Clause # Example license