Skip to content

Commit

Permalink
converted pinax.apps.topics to use django-taggit
Browse files Browse the repository at this point in the history
  • Loading branch information
paltman committed Sep 11, 2010
1 parent 6283d27 commit f82e388
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion docs/apps/topics/gettingstarted.txt
Expand Up @@ -15,7 +15,7 @@ These are the requirements to run ``pinax.apps.account``:


* Python **2.4+** (Python 3.x is **not** supported yet) * Python **2.4+** (Python 3.x is **not** supported yet)
* Django **1.2+** * Django **1.2+**
* django-tagging * django-taggit
* django-threadedcomments * django-threadedcomments


These dependencies should be added to your ``requirements/project.txt`` file These dependencies should be added to your ``requirements/project.txt`` file
Expand Down
5 changes: 2 additions & 3 deletions pinax/apps/topics/models.py
Expand Up @@ -14,11 +14,10 @@
else: else:
notification = None notification = None


from tagging.fields import TagField from taggit.managers import TaggableManager
from threadedcomments.models import ThreadedComment from threadedcomments.models import ThreadedComment





class Topic(models.Model): class Topic(models.Model):
""" """
a discussion topic for the tribe. a discussion topic for the tribe.
Expand All @@ -37,7 +36,7 @@ class Topic(models.Model):
modified = models.DateTimeField(_("modified"), default=datetime.now) # topic modified when commented on modified = models.DateTimeField(_("modified"), default=datetime.now) # topic modified when commented on
body = models.TextField(_("body"), blank=True) body = models.TextField(_("body"), blank=True)


tags = TagField() tags = TaggableManager()


class Meta: class Meta:
ordering = ["-modified"] ordering = ["-modified"]
Expand Down
3 changes: 1 addition & 2 deletions pinax/templates/default/topics/topic.html
Expand Up @@ -3,7 +3,6 @@
{% load i18n %} {% load i18n %}
{% load account_tags %} {% load account_tags %}
{% load uni_form_tags %} {% load uni_form_tags %}
{% load extra_tagging_tags %}
{% load pagination_tags %} {% load pagination_tags %}
{% load comments_tag %} {% load comments_tag %}
{% load avatar_tags %} {% load avatar_tags %}
Expand All @@ -24,7 +23,7 @@
<div class="bulk"> <div class="bulk">
<h1>{{ topic.title }}</h1> <h1>{{ topic.title }}</h1>
<div class="body">{{ topic.body|urlize|linebreaks }}</div> <div class="body">{{ topic.body|urlize|linebreaks }}</div>
<p>{% show_tags_for topic %}</p> <p>{% topic.tags.all %}</p>
{% ifequal user topic.creator %} {% ifequal user topic.creator %}
<form class="uniForm" method="POST" action="{{ request.path }}delete/"> <form class="uniForm" method="POST" action="{{ request.path }}delete/">
{% csrf_token %} {% csrf_token %}
Expand Down
3 changes: 1 addition & 2 deletions pinax/templates/default/topics/topic_item.html
Expand Up @@ -2,7 +2,6 @@
{% load account_tags %} {% load account_tags %}
{% load avatar_tags %} {% load avatar_tags %}
{% load threadedcommentstags %} {% load threadedcommentstags %}
{% load extra_tagging_tags %}
{% load group_tags %} {% load group_tags %}


<div class="topic clearfix"> <div class="topic clearfix">
Expand All @@ -23,6 +22,6 @@ <h2><a href="{% groupurl topic_detail group topic_id=topic.id %}">{{ topic.title
{% endblocktrans %} {% endblocktrans %}
</div> </div>
{% endif %} {% endif %}
<p>{% show_tags_for topic %}</p> <p>{% topic.tags.all %}</p>
</div> </div>
</div> </div>

0 comments on commit f82e388

Please sign in to comment.