Fix bad merge
[cascardo/ema.git] / urls.py
diff --git a/urls.py b/urls.py
index 03c46cd..89b3856 100644 (file)
--- a/urls.py
+++ b/urls.py
@@ -22,17 +22,21 @@ from diario.models import Entry
 from contents.models import Menu, Index
 from ema.views import get_entry_by_slug
 
+from django.contrib import admin
+admin.autodiscover()
+
+
 MEDIA = {'document_root': settings.INSTANCE('media')}
 
 # the only difference between info_dict and info_dict_full is that the
 # full version contains all entries and the other has just entries
 # without menus.
 
-hasmenuorindex = [x.entry.id for x in Menu.objects.all()]
-hasmenuorindex.extend([x.entry.id for x in Index.objects.all()])
+hasmenu = [x.entry.id for x in Menu.objects.all()]
+inindex = [x.entry.id for x in Index.objects.all()]
 
 info_dict = {
-    'queryset': Entry.published_on_site.exclude(id__in=hasmenuorindex),
+    'queryset': Entry.published_on_site.exclude(id__in=hasmenu).filter(id__in=inindex),
     'template_object_name': 'entry',
     'extra_context': {'menus': Menu.objects.all()},
 }
@@ -44,7 +48,7 @@ info_dict_full = {
 }
 
 urlpatterns = patterns('',
-    (r'^admin/', include('django.contrib.admin.urls')),
+    (r'^admin/(.*)', admin.site.root),
 
     url(regex='^$',
         view='django.views.generic.list_detail.object_list',
@@ -57,8 +61,8 @@ urlpatterns = patterns('',
                     date_field='pub_date'),
         name='diario-entry'),
 
-    (r'^([-\w]+)/$', get_entry_by_slug),
     (r'^', include('ema.eventos.urls')),
+    (r'^([-\w]+)/$', get_entry_by_slug),
 
     # static media
     (r'^(?P<path>imgs/.*)$', 'django.views.static.serve', MEDIA),