Note that there are some explanatory texts on larger screens.

plurals
  1. PODjango: Is there a way to set global views? For example enable data for a sidebar through all URLS
    primarykey
    data
    text
    <p>I am building a Django application that is a pretty basic blog, so far it has been wonderful. I got comments, tags etc up. But one thing is bugging me: I cant get the sidebar i want to work. I use the django.views.generic.date_based generic view and this is my urls.py for the blog: </p> <pre><code> urlpatterns = patterns('django.views.generic.date_based', (r'(?P&lt;year&gt;\d{4})/(?P&lt;month&gt;[a-z]{3})/(?P&lt;day&gt;\w{1,2})/(?P&lt;slug&gt;[-\w]+)/$', 'object_detail',dict(info_dict, slug_field='slug',template_name='blog/detail.html')), (r'^(?P&lt;year&gt;\d{4})/(?P&lt;month&gt;[a-z]{3})/(?P&lt;day&gt;w{1,2})/(?P&lt;slug&gt;[-\w]+)/$', 'object_detail', dict(info_dict, template_name='blog/list.html')), (r'^(?P&lt;year&gt;\d{4})/(?P&lt;month&gt;[a-z]{3})/(?P&lt;day&gt;w{1,2})/$','archive_day',dict(info_dict,template_name='blog/list.html')), (r'^(?P&lt;year&gt;\d{4})/(?P&lt;month&gt;[a-z]{3})/$','archive_month', dict(info_dict, template_name='blog/list.html')), (r'^(?P&lt;year&gt;\d{4})/$','archive_year', dict(info_dict, template_name='blog/list.html')), (r'^$','archive_index', dict(info_dict, template_name='blog/list.html')), ) </code></pre> <p>When i use the URL with 'archive_index' passed i can easily print the latest entries for my sidebar, but when i enter a post i will use one of the top ones where only "object_detail" is availabe. This makes my sidebar entries dissapear. What is the best solution to this problem? Is there a way to make some objects available globally? Through views or otherwise.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload