Skip to content

Made the shallow urls.py work as suggested #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 23 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
2e5a756
Update faq/urls/shallow.py
coordt Aug 20, 2012
26a8394
Version 0.8.4: Made registering search indexes optional via setting
coordt Feb 4, 2013
0beabb2
Replacing old generic views with class based ones. Making {% url tags…
teosibileau Jul 24, 2013
35b5722
Merge remote-tracking branch 'drkloc/master'
coordt Dec 26, 2013
1f04a78
Version bump to 0.8.5
coordt Dec 26, 2013
8932d30
0.8.6: Django 1.5 compatibility
coordt Dec 30, 2013
0f711aa
Initial Django 1.7 migrations
coordt Apr 23, 2015
8d927a8
Updates get_query_set to get_queryset for Django 1.8
coordt Feb 24, 2016
6c4f8b7
Updating setup.py for latest setuptools
coordt Feb 24, 2016
00507a7
[0.9] Update fixtures data to include TZ
coordt Sep 28, 2017
e5b63d2
[0.9] Refactor urls and views.
coordt Sep 28, 2017
0b7f39d
[0.9] Updated tests to override urls appropriately
coordt Sep 28, 2017
c157718
[0.9] Python 3 update
coordt Sep 28, 2017
46bfc00
[0.9] Add tox support
coordt Sep 28, 2017
2a8e4fc
[0.9] Update packaging info, versioning info and runtest script
coordt Sep 28, 2017
7532d77
Updated setup.py to include tagging and publishing commands
coordt Sep 28, 2017
a3ba9b1
[0.9.1] Update packaging to remove rogue views directory
coordt Sep 28, 2017
819597b
Added coverage.py to the tox config and ignored the artifacts for git
coordt Sep 28, 2017
3e6cb51
run 2to3 conversion
Dec 20, 2019
dcd8005
[THAN-168] - Replace __unicode__ with __str__
daniel-mq Jan 15, 2020
fc3526b
[THAN-168] - Replace unnecessary test
daniel-mq Jan 15, 2020
82fc8f2
Bump version to 1.0.0
dpfrakes Jan 28, 2020
1aa924e
Merge pull request #1 from natgeosociety/python3
akandada Feb 28, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,9 @@ build/
dist/
docs/_build
MANIFEST
*.egg-info
.tox/
.cache/
.coverage
junit-*.xml
coverage.xml
8 changes: 4 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
============================================================
Frequently Asked Question (FAQ) management for Django apps
============================================================
==========================================================
Frequently Asked Question (FAQ) management for Django apps
==========================================================

This Django_ application provides the ability to create and manage lists of
Frequently Asked Questions (FAQ), organized by topic.
Expand All @@ -12,7 +12,7 @@ months.

.. _Django: http://www.djangoproject.com/

TODOs
TODO's
------

Below are tasks that need done, features under consideration, and some
Expand Down
12 changes: 6 additions & 6 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
master_doc = 'index'

# General information about the project.
project = u'django-faq'
copyright = u'2012, Ben Spaulding'
project = 'django-faq'
copyright = '2012, Ben Spaulding'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
Expand Down Expand Up @@ -184,8 +184,8 @@
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
('index', 'django-faq.tex', u'django-faq Documentation',
u'Ben Spaulding', 'manual'),
('index', 'django-faq.tex', 'django-faq Documentation',
'Ben Spaulding', 'manual'),
]

# The name of an image file (relative to this directory) to place at the top of
Expand Down Expand Up @@ -217,8 +217,8 @@
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'django-faq', u'django-faq Documentation',
[u'Ben Spaulding'], 1)
('index', 'django-faq', 'django-faq Documentation',
['Ben Spaulding'], 1)
]


Expand Down
27 changes: 20 additions & 7 deletions faq/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,23 @@

"""

from django.utils.translation import ugettext_lazy as _


__version__ = '0.8.3'

# Mark the app_label for translation.
_(u'faq')
__version_info__ = {
'major': 1,
'minor': 0,
'micro': 0,
'releaselevel': 'final',
'serial': 1
}


def get_version(short=False):
assert __version_info__['releaselevel'] in ('alpha', 'beta', 'final')
vers = ["%(major)i.%(minor)i" % __version_info__, ]
if __version_info__['micro']:
vers.append(".%(micro)i" % __version_info__)
if __version_info__['releaselevel'] != 'final' and not short:
vers.append('%s%i' % (
__version_info__['releaselevel'][0], __version_info__['serial']))
return ''.join(vers)

__version__ = get_version()
20 changes: 9 additions & 11 deletions faq/admin.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# -*- coding: utf-8 -*-

from django.contrib import admin
from django.contrib.sites.models import Site
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import ugettext_noop, ungettext

Expand All @@ -26,8 +25,8 @@ def update_status(modeladmin, request, queryset, status):
obj.save()
# Now log what happened.
# Use ugettext_noop() 'cause this is going straight into the db.
log_message = ugettext_noop(u'Changed status to \'%s\'.' %
obj.get_status_display())
log_message = ugettext_noop('Changed status to \'%s\'.' %
obj.get_status_display())
modeladmin.log_change(request, obj, log_message)

# Send a message to the user telling them what has happened.
Expand All @@ -39,8 +38,8 @@ def update_status(modeladmin, request, queryset, status):
if not message_dict['count'] == 1:
message_dict['object'] = modeladmin.model._meta.verbose_name_plural
user_message = ungettext(
u'%(count)s %(object)s was successfully %(verb)s.',
u'%(count)s %(object)s were successfully %(verb)s.',
'%(count)s %(object)s was successfully %(verb)s.',
'%(count)s %(object)s were successfully %(verb)s.',
message_dict['count']) % message_dict
modeladmin.message_user(request, user_message)

Expand All @@ -53,19 +52,19 @@ def update_status(modeladmin, request, queryset, status):
def draft(modeladmin, request, queryset):
"""Admin action for setting status of selected items to 'drafted'."""
return update_status(modeladmin, request, queryset, DRAFTED)
draft.short_description = _(u'Draft selected %(verbose_name_plural)s')
draft.short_description = _('Draft selected %(verbose_name_plural)s')


def publish(modeladmin, request, queryset):
"""Admin action for setting status of selected items to 'published'."""
return update_status(modeladmin, request, queryset, PUBLISHED)
publish.short_description = _(u'Publish selected %(verbose_name_plural)s')
publish.short_description = _('Publish selected %(verbose_name_plural)s')


def remove(modeladmin, request, queryset):
"""Admin action for setting status of selected items to 'removed'."""
return update_status(modeladmin, request, queryset, REMOVED)
remove.short_description = _(u'Remove selected %(verbose_name_plural)s')
remove.short_description = _('Remove selected %(verbose_name_plural)s')


# Inlines.
Expand Down Expand Up @@ -99,14 +98,13 @@ class TopicAdmin(FAQAdminBase):
def question_count(self, obj):
"""Returns the total number of Questions for this topic."""
return obj.questions.count()
question_count.short_description = _(u'No. of Questions')
question_count.short_description = _('No. of Questions')


class QuestionAdmin(FAQAdminBase):
fieldsets = (
(None, {
'fields': ('topic', 'question', 'slug', 'answer', 'status',
'ordering')}),
'fields': ('topic', 'question', 'slug', 'answer', 'status', 'ordering')}),
)
list_display = ('question', 'topic', 'status', 'ordering')
list_filter = ('status', 'topic', 'modified', 'created')
Expand Down
Loading