Skip to content

Commit

Permalink
Modified to use django-tagging-ext rather than tagging-utils
Browse files Browse the repository at this point in the history
  • Loading branch information
pydanny committed Feb 22, 2010
1 parent 9d38b97 commit 40b3fd2
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions pinax/projects/code_project/urls.py
Expand Up @@ -41,6 +41,41 @@
(r"^admin/", include(admin.site.urls)),
)

from tagging.models import TaggedItem

from projects.models import Project
from tasks.models import Task
from topics.models import Topic as ProjectTopic
from wiki.models import Article as WikiArticle

tagged_models = (
dict(title="Projects",
query=lambda tag: TaggedItem.objects.get_by_model(Project, tag),
),
dict(title="Project Topics",
query=lambda tag: TaggedItem.objects.get_by_model(ProjectTopic, tag),
),
dict(title="Project Tasks",
query=lambda tag: TaggedItem.objects.get_by_model(Task, tag),
),
dict(title="Wiki Articles",
query=lambda tag: TaggedItem.objects.get_by_model(WikiArticle, tag),
),


)
tagging_ext_kwargs = {
'tagged_models':tagged_models,
}

urlpatterns += patterns('',
url(r'^tags/(?P<tag>.+)/(?P<model>.+)$', 'tagging_ext.views.tag_by_model',
kwargs=tagging_ext_kwargs, name='tagging_ext_tag_by_model'),
url(r'^tags/(?P<tag>.+)/$', 'tagging_ext.views.tag',
kwargs=tagging_ext_kwargs, name='tagging_ext_tag'),
url(r'^tags/$', 'tagging_ext.views.index', name='tagging_ext_index'),
)


if settings.SERVE_MEDIA:
urlpatterns += patterns("",
Expand Down

0 comments on commit 40b3fd2

Please sign in to comment.