adding a new feature, now you need to say which content
authorLincoln de Sousa <lincoln@alfaiati.net>
Wed, 8 Oct 2008 18:38:48 +0000 (15:38 -0300)
committerLincoln de Sousa <lincoln@alfaiati.net>
Wed, 8 Oct 2008 18:38:48 +0000 (15:38 -0300)
will be placed on the index (needs a database update)

contents/models.py
urls.py

index e111b2f..78c760f 100644 (file)
@@ -27,3 +27,12 @@ class Menu(models.Model):
 
     def __str__(self):
         return self.title
 
     def __str__(self):
         return self.title
+
+class Index(models.Model):
+    entry = models.ForeignKey(Entry)
+
+    class Admin:
+        pass
+
+    def __str__(self):
+        return self.entry.title
diff --git a/urls.py b/urls.py
index b625832..03c46cd 100644 (file)
--- a/urls.py
+++ b/urls.py
@@ -19,7 +19,7 @@ from django.conf.urls.defaults import *
 from django.conf import settings
 from diario.settings import DIARIO_NUM_LATEST
 from diario.models import Entry
 from django.conf import settings
 from diario.settings import DIARIO_NUM_LATEST
 from diario.models import Entry
-from contents.models import Menu
+from contents.models import Menu, Index
 from ema.views import get_entry_by_slug
 
 MEDIA = {'document_root': settings.INSTANCE('media')}
 from ema.views import get_entry_by_slug
 
 MEDIA = {'document_root': settings.INSTANCE('media')}
@@ -28,9 +28,11 @@ MEDIA = {'document_root': settings.INSTANCE('media')}
 # full version contains all entries and the other has just entries
 # without menus.
 
 # full version contains all entries and the other has just entries
 # without menus.
 
-hasmenu = [x.entry.id for x in Menu.objects.all()]
+hasmenuorindex = [x.entry.id for x in Menu.objects.all()]
+hasmenuorindex.extend([x.entry.id for x in Index.objects.all()])
+
 info_dict = {
 info_dict = {
-    'queryset': Entry.published_on_site.exclude(id__in=hasmenu),
+    'queryset': Entry.published_on_site.exclude(id__in=hasmenuorindex),
     'template_object_name': 'entry',
     'extra_context': {'menus': Menu.objects.all()},
 }
     'template_object_name': 'entry',
     'extra_context': {'menus': Menu.objects.all()},
 }