Skip to content

Commit

Permalink
more content type bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
chriscauley committed Sep 13, 2015
1 parent daef783 commit c1a3c34
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion thing/views.py
Expand Up @@ -30,7 +30,7 @@
def thing_index(request):
things = Thing.objects.filter(active=True)
#tool_filter = filters['tool']()
#contenttype = ContentType.objects.get(name="thing")
#contenttype = ContentType.objects.get(model="thing")
#for tool in tool_filter['options']:
# tool.count = TaggedTool.objects.filter(tool_id=tool.id,content_type=contenttype).count()
#tool_filter['options'] = [t for t in tool_filter['options'] if t.count > 1]
Expand Down
4 changes: 2 additions & 2 deletions tool/models.py
Expand Up @@ -45,12 +45,12 @@ class Meta:
# Abstract the next two!
@cached_property
def courses(self):
ct_id = ContentType.objects.get(name="course").id
ct_id = ContentType.objects.get(model="course").id
tagged = list(TaggedTool.objects.filter(content_type__id=ct_id,tool=self))
return [t.content_object for t in tagged]
@cached_property
def things(self):
ct_id = ContentType.objects.get(name="thing").id
ct_id = ContentType.objects.get(model="thing").id
tagged = list(TaggedTool.objects.filter(content_type__id=ct_id,tool=self))
return [t.content_object for t in tagged]

Expand Down

0 comments on commit c1a3c34

Please sign in to comment.