public
Description: A full featured and opinionated blogging solution using Django
Homepage: http://lethain.com/projects/lifeflow/
Clone URL: git://github.com/lethain/lifeflow.git
Updated context to have 5 random and 5 recent entries (instead of 3).
lethain (author)
Sun Sep 21 13:01:42 -0700 2008
commit  035e8d4a79bb19736b47a2eea16bbfcb9e3ffe48
tree    0493b235a4bdd389a41c7a1d32b1914aded59b45
parent  02e83e0612ab1ab57ba0335446b6de44e3955f9f
...
6
7
8
9
10
 
 
11
12
13
...
6
7
8
 
 
9
10
11
12
13
0
@@ -6,8 +6,8 @@ from django.conf import settings
0
 def blog(request):
0
     def make_slug(str):
0
         return str.lower().replace(" ","-")
0
-    recent = Entry.current.all()[:3]
0
-    random = Entry.current.all().order_by('?')[:3]
0
+    recent = Entry.current.all()[:5]
0
+    random = Entry.current.all().order_by('?')[:5]
0
     blog_roll = RecommendedSite.objects.all()
0
     flows = Flow.objects.all()
0
     site = Site.objects.get(pk=settings.SITE_ID)
...
489
490
491
 
 
 
492
493
494
...
489
490
491
492
493
494
495
496
497
0
@@ -489,6 +489,9 @@ class Tag(models.Model):
0
     def get_absolute_url(self):
0
         return u"/tags/%s/" % self.slug
0
 
0
+    def random(self):
0
+        return self.entry_set.all().order_by('?')
0
+
0
     def latest(self, qty=None):
0
         if qty is None:
0
             return self.entry_set.all().filter(**{'pub_date__lte': datetime.datetime.now()})

Comments