Skip to content

Commit

Permalink
1.7 add support for django 5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
smark-1 committed Dec 24, 2023
1 parent 36345f7 commit 99acd27
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 38 deletions.
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022 dragoncommits
Copyright (c) 2023 smark-1

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -338,4 +338,6 @@ django-easy-faq aims to be the best faq app for django. It welcomes contributio

1.5 added login_required setting to allow faq app to be available to only logged in users

1.6 fixed bug where no_category_description did not do remove the category description in the admin
1.6 fixed bug where no_category_description did not do remove the category description in the admin

1.7 added support for django 5.0
11 changes: 6 additions & 5 deletions django_easy_faq.egg-info/PKG-INFO
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
Metadata-Version: 2.1
Name: django-easy-faq
Version: 1.6
Version: 1.7
Summary: A Django app to add great faq functionality to website.
Home-page: https://github.com/dragoncommits/django-easy-faq
License: BSD-3-Clause
Platform: UNKNOWN
Classifier: Environment :: Web Environment
Classifier: Framework :: Django
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
Requires-Python: >=3.6
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE.txt
License-File: license
Requires-Dist: Django>=3.2

# django-easy-faq

Expand Down Expand Up @@ -365,3 +365,4 @@ django-easy-faq aims to be the best faq app for django. It welcomes contributio

1.6 fixed bug where no_category_description did not do remove the category description in the admin

1.7 added support for django 5.0
1 change: 0 additions & 1 deletion django_easy_faq.egg-info/SOURCES.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
LICENSE.txt
MANIFEST.in
README.md
license
setup.cfg
setup.py
django_easy_faq.egg-info/PKG-INFO
Expand Down
2 changes: 1 addition & 1 deletion django_easy_faq.egg-info/requires.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Django>=3.0
Django>=3.2
21 changes: 17 additions & 4 deletions faq/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ def __str__(self):

def save(self, *args, **kwargs):
self.slug = slugify(self.question, allow_unicode='allow_unicode' in settings.FAQ_SETTINGS)[:150]
self.helpful = self.get_helpful()
self.not_helpful = self.get_not_helpful()
# if question already exists
if self.pk:
self.helpful = self.get_helpful()
self.not_helpful = self.get_not_helpful()
return super().save(*args, **kwargs)

def get_absolute_url(self):
Expand All @@ -37,6 +39,10 @@ def get_absolute_url(self):
return reverse("faq:question_detail", args=(self.slug,))


class Meta:
app_label = 'faq'


class Answer(models.Model):
question = models.ForeignKey(Question, on_delete=models.CASCADE)
answer = models.TextField()
Expand All @@ -55,6 +61,7 @@ def __str__(self):

class Meta:
order_with_respect_to = 'question'
app_label = 'faq'

def save(self, *args, **kwargs):
# if first time saving add a new slug
Expand All @@ -63,8 +70,10 @@ def save(self, *args, **kwargs):
while Answer.objects.filter(slug=new_slug, answer=self.answer).exists():
new_slug = snippets.create_random_slug()
self.slug = new_slug
self.helpful = self.get_helpful()
self.not_helpful = self.get_not_helpful()
# if answer is not new
if self.pk:
self.helpful = self.get_helpful()
self.not_helpful = self.get_not_helpful()
super().save(*args, **kwargs)


Expand All @@ -78,6 +87,7 @@ def __str__(self):

class Meta:
verbose_name_plural = "categories"
app_label = 'faq'

@property
def description(self):
Expand All @@ -103,6 +113,7 @@ def __str__(self):

class Meta:
ordering = ['question', '-post_time']
app_label = 'faq'


class AnswerHelpful(models.Model):
Expand All @@ -120,6 +131,7 @@ def __str__(self):

class Meta:
ordering = ['answer', 'vote']
app_label = 'faq'


class QuestionHelpful(models.Model):
Expand All @@ -137,3 +149,4 @@ def __str__(self):

class Meta:
ordering = ['question', 'vote']
app_label = 'faq'
21 changes: 0 additions & 21 deletions license

This file was deleted.

9 changes: 5 additions & 4 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = django-easy-faq
version = 1.6
version = 1.7
description = A Django app to add great faq functionality to website.
long_description = file: README.md
long_description_content_type = text/markdown
Expand All @@ -13,17 +13,18 @@ classifiers =
License :: OSI Approved :: BSD License
Operating System :: OS Independent
Programming Language :: Python
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Programming Language :: Python :: 3.12
Topic :: Internet :: WWW/HTTP
Topic :: Internet :: WWW/HTTP :: Dynamic Content

[options]
include_package_data = true
packages = find:
python_requires = >=3.6
python_requires = >=3.7
install_requires =
Django >= 3.0
Django >= 3.2

0 comments on commit 99acd27

Please sign in to comment.