Commits

hirunatan committed 5a69bf2

Strip blanks

  • Participants
  • Parent commits 0676225

Comments (0)

Files changed (1)

src/macadjan_base/views.py

     def get(self, request, category_slug = None, subcategory_slug = None):
         map_arguments = MapArguments(request, category_slug, subcategory_slug)
         context = self.get_context_data(request, map_arguments)
-        return render_to_response('macadjan_base/map_iframe.html', 
+        return render_to_response('macadjan_base/map_iframe.html',
             context, context_instance = RequestContext(request))
 
     def get_context_data(self, request, map_arguments):
         context = map_arguments.get_context_data()
         features = OpenLayersFeatures()
-        features.make_features(map_arguments.category, map_arguments.subcategory, 
+        features.make_features(map_arguments.category, map_arguments.subcategory,
                                map_arguments.map_source, map_arguments.keywords)
         context.update({
             'features': features.features_string,
     def get(self, request, category_slug = None, subcategory_slug = None):
         map_arguments = MapArguments(request, category_slug, subcategory_slug)
         context = self.get_context_data(request, map_arguments)
-        return render_to_response('macadjan_base/map_kml.kml', 
+        return render_to_response('macadjan_base/map_kml.kml',
             context, context_instance = RequestContext(request),
             mimetype = 'application/vnd.google-earth.kml+xml')
 
         entities = entities.order_by('-modification_date')
         entities_list = models.Entity.objects_active.filter_with_keywords(entities,
                                                                           map_arguments.keywords)
-        entities_urls = [(entity, 'http://' + Site.objects.get_current().domain + 
+        entities_urls = [(entity, 'http://' + Site.objects.get_current().domain +
                                   reverse('base:entity', kwargs={'entity_slug': entity.slug}))
                          for entity in entities_list]
 
     def get(self, request, category_slug = None, subcategory_slug = None):
         map_arguments = MapArguments(request, category_slug, subcategory_slug)
         context = self.get_context_data(request, map_arguments)
-        return render_to_response('macadjan_base/geo_rss.xml', 
+        return render_to_response('macadjan_base/geo_rss.xml',
             context, context_instance = RequestContext(request),
             mimetype = 'application/rss+xml')
 
         entities = entities.order_by('-modification_date')
         entities_list = models.Entity.objects_active.filter_with_keywords(entities,
                                                                           map_arguments.keywords)
-        entities_urls = [(entity, 'http://' + Site.objects.get_current().domain + 
+        entities_urls = [(entity, 'http://' + Site.objects.get_current().domain +
                                   reverse('base:entity', kwargs={'entity_slug': entity.slug}))
                          for entity in entities_list]
 
 
         paginator = Paginator(entities_list, 13);
         pages = []
-        for pagenum in paginator.page_range:    
+        for pagenum in paginator.page_range:
             pages.append((obj for obj in paginator.page(pagenum).object_list))
 
         context.update({
 
             for entity in entities_list:
                 title, description = (
-                    u'<a href="%s" target="_blank">%s</a>' % ('http://' + Site.objects.get_current().domain + 
+                    u'<a href="%s" target="_blank">%s</a>' % ('http://' + Site.objects.get_current().domain +
                                                                   reverse('base:entity', kwargs={'entity_slug': entity.slug}),
                                                               entity.name),
                     u'<br/>%s' % entity.summary
                 if not marker_url:
                     raise ValueErorr(_(u'Debes definir el DEFAULT_MARKER_URL en los settings.'))
 
-                text += u'%f\t%f\t%s\t%d,%d\t%d,%d\t%s\t%s\t%d,%d\n' % (entity.latitude, 
+                text += u'%f\t%f\t%s\t%d,%d\t%d,%d\t%s\t%s\t%d,%d\n' % (entity.latitude,
                                 entity.longitude, settings.STATIC_URL + marker_url,
                                 32, 37, 0, -37, title, description, 300, 120)
 
             messages.error(request, _(u'No se han podido importar los datos'))
         context = self.get_context_data()
         return self.render_to_response(context)
-   
+
     def get_context_data(self, **kwargs):
         context = super(Import, self).get_context_data(**kwargs)
         context.update({
                 'import_form': self.import_form,
             })
         return context
-	
+
     @staff_required()
-    def dispatch(self, request, *args, **kwargs):  
+    def dispatch(self, request, *args, **kwargs):
         self.importer_name = kwargs.get('importer_name')
         self.importer = import_page_base.find_importer(self.importer_name)
         if not self.importer:
                 'import_result': self.import_result,
             })
         return context
-	
+
     @staff_required()
     def dispatch(self, request, *args, **kwargs):
         self.importer_name = kwargs.get('importer_name')
     def send_mail_to_managers(self, proposal):
         current_site = Site.objects.get_current()
         site_info = current_site.site_info
-        
+
         email_subject = _(u'[%(website_name)s] Se ha recibido una solicitud de entidad nueva') % \
                        {'website_name': site_info.website_name}
         email_from = settings.DEFAULT_FROM_EMAIL
         email_template = loader.get_template('macadjan_base/email_notify_proposal_to_managers.txt')
         email_context = Context({
             'entity_name': proposal.name,
-            'sender': (_(u'Dirección del remitente: %s') % proposal.proponent_email) 
+            'sender': (_(u'Dirección del remitente: %s') % proposal.proponent_email)
                        if proposal.proponent_email else _(u'Sin dirección de remitente.'),
             'comment': proposal.proponent_comment
                        if proposal.proponent_comment else _(u'Sin comentarios del remitente.'),
 
             current_site = Site.objects.get_current()
             site_info = current_site.site_info
-            
+
             email_subject = _(u'Hemos recibido tu solicitud para dar de alta %(entity_name)s en %(website_name)s') % \
                            {'entity_name': proposal.name,
                             'website_name': site_info.website_name}