Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

support for tagging in admin

  • Loading branch information...
commit c0189422df835bef3903b43e408b4ce6d3480e33 1 parent 2bc6e13
Justine Tunney authored
View
4 occupywallst/admin.py
@@ -18,6 +18,8 @@
from django.contrib.gis.admin import OSMGeoAdmin
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin, GroupAdmin
+import taggit.admin
+
from occupywallst import models as db
@@ -38,6 +40,8 @@ def __init__(self, *args, **kwargs):
self.register(db.List, ListAdmin)
self.register(db.ListMember, ListMemberAdmin)
self.register(db.Pledge, PledgeAdmin)
+ self.register(taggit.admin.Tag, taggit.admin.TagAdmin)
+ self.register(taggit.admin.TaggedItem)
# message table intentionally excluded. i don't want to tempt
# myself or anyone else using the backend to read private
# conversations.
View
2  occupywallst/models.py
@@ -32,6 +32,7 @@
from django.template.defaultfilters import slugify
from imagekit.models import ImageSpec
+from taggit.managers import TaggableManager
from occupywallst.utils import jsonify
from occupywallst import geo
@@ -452,6 +453,7 @@ class Article(models.Model):
lambda self, val: setattr(self, 'author', val))
objects = models.GeoManager()
+ tags = TaggableManager()
@classmethod
def objects_as(cls, user):
View
3  occupywallst/settings.py
@@ -118,6 +118,8 @@
# SESSION_ENGINE = 'occupywallst.memcachedjson'
USE_X_FORWARDED_HOST = True
ROSETTA_MESSAGES_PER_PAGE = 25
+TAGGIT_FORCE_LOWERCASE = True
+TAGGIT_STOPWORDS = ['a', 'an', 'and', 'be', 'from', 'of']
gettext_noop = lambda s: s
LANGUAGE_CODE = 'en'
@@ -181,6 +183,7 @@
'django.contrib.gis',
'rosetta',
'south',
+ 'taggit',
]
LOGGING = {
View
3  setup.py
@@ -26,7 +26,8 @@ def read(fname):
'markdown', 'twilio', 'django-debug-toolbar',
'recaptcha-client', 'gunicorn', 'django-rosetta',
'django-imagekit', 'Whoosh', 'redis', 'redisbayes',
- 'python-memcached>=1.40', 'slimit', 'cssmin'],
+ 'python-memcached>=1.40', 'slimit', 'cssmin',
+ 'django-taggit'],
packages = find_packages(),
include_package_data = True,
zip_safe = False,
Please sign in to comment.
Something went wrong with that request. Please try again.