V0.14 : update tags management V00.14
authorcavaliet
Tue, 29 Apr 2014 12:38:32 +0200
changeset 156 b2579c9ec182
parent 155 7e8492a5c70f
child 157 722df86be79f
V0.14 : update tags management
src/hashcut/__init__.py
src/hashcut/views.py
--- a/src/hashcut/__init__.py	Tue Oct 01 16:37:24 2013 +0200
+++ b/src/hashcut/__init__.py	Tue Apr 29 12:38:32 2014 +0200
@@ -1,4 +1,4 @@
-VERSION = (0, 13, 0, "final", 0)
+VERSION = (0, 14, 0, "final", 0)
 
 
 def get_version():
--- a/src/hashcut/views.py	Tue Oct 01 16:37:24 2013 +0200
+++ b/src/hashcut/views.py	Tue Apr 29 12:38:32 2014 +0200
@@ -50,7 +50,7 @@
         if l>2:
             last_mashups = mashups[2:]
         
-        contents = Content.objects.filter(tags__icontains=branding).order_by('?')[:4]
+        contents = Content.objects.filter(tags__name__icontains=branding).order_by('?')[:4]
         
         context = self.get_context_dict(request)
         context.update({"mashups":last_mashups, "contents": contents, "m1":m1, "m2":m2})
@@ -194,7 +194,7 @@
         page = request.GET.get("page") or 1
         self.branding = branding
         
-        contents = Content.objects.filter(tags__icontains=branding)
+        contents = Content.objects.filter(tags__name__icontains=branding)
         nb = getattr(settings, 'LDT_FRONT_MEDIA_PER_PAGE', 9)
         if page=="x":
             nb = contents.count()