Commits

Mikhail Korobov committed a8d2511

Add support for context processors

Comments (0)

Files changed (3)

photo_albums/urls.py

     
     def __init__(self, instance_name, queryset, app_name='album', 
                  extra_context=None, template_object_name = 'object',
-                 has_edit_permission = lambda request, obj: True):
+                 has_edit_permission = lambda request, obj: True,
+                 context_processors=None):
         
         super(PhotoAlbumSite, self).__init__(instance_name, queryset, app_name, 
                                              extra_context, template_object_name,
-                                             has_edit_permission)
+                                             has_edit_permission, context_processors)
                 
     def patterns(self):
         return patterns('photo_albums.views',

photo_albums/views.py

     context.update({'images': images})
     return render_to_response(get_template_names(object, template_name), 
                               context,
-                              context_instance=RequestContext(request),
+                              context_instance=RequestContext(request, processors=album_site.context_processors),
                               )
     
 
         
     return render_to_response(get_template_names(object, template_name), 
                               context,
-                              context_instance=RequestContext(request),
+                              context_instance=RequestContext(request, processors=album_site.context_processors),
                               )
     
     
     return render_to_response(
                                 get_template_names(object, 'upload_main_image.html'),
                                 context,
-                                context_instance=RequestContext(request),
+                                context_instance=RequestContext(request, processors=album_site.context_processors),
                              )
 
 
     
     return render_to_response(get_template_names(object, 'upload_images.html'), 
                               context, 
-                              context_instance=RequestContext(request))
+                              context_instance=RequestContext(request, processors=album_site.context_processors))
 
 
 def show_image(request, object_id, image_id, album_site, template_name = 'show_image.html'):
 
     return render_to_response(get_template_names(object, template_name), 
                               context, 
-                              context_instance=RequestContext(request))
+                              context_instance=RequestContext(request, processors=album_site.context_processors))
 
 
 @login_required
                          post_delete_redirect = next_url, 
                          object_id = image_id,
                          extra_context = context, 
+                         context_processors=album_site.context_processors,
                          template_name = get_template_names(object, 'confirm_delete.html')[1])
 
 
 
 setup(
       name='django-photo-albums',
-      version='0.1',
+      version='0.11',
       author='Mikhail Korobov',
       author_email='kmike84@gmail.com',
       url='http://bitbucket.org/kmike/django-photo-albums/',      
       license = 'MIT license',
       packages=['photo_albums'],
       requires = ['django (>=1.1)'],
-      install_requires=['django-generic-images >= 0.12', 'django-annoying > 0.5'],
+      install_requires=['django-generic-images >= 0.14', 'django-annoying > 0.5'],
       
       classifiers=(
           'Development Status :: 3 - Alpha',