Ejemplo n.º 1
0
 def get_kml_url(self, obj):
     url = reverse('sensitivity:sensitivearea_kml_detail',
                   kwargs={
                       'lang': get_language(),
                       'pk': obj.pk
                   })
     return build_url(self, url)
Ejemplo n.º 2
0
 def get_altimetric_profile_url(self, obj):
     return build_url(
         self,
         reverse('trekking:trek_profile',
                 kwargs={
                     'lang': get_language(),
                     'pk': obj.pk
                 }))
Ejemplo n.º 3
0
 def get_url(self, obj):
     if obj.attachment_file:
         return build_url(self, obj.attachment_file.url)
     if obj.attachment_video:
         return obj.attachment_video
     if obj.attachment_link:
         return obj.attachment_link
     return ""
Ejemplo n.º 4
0
 def get_elevation_svg_url(self, obj):
     return build_url(
         self,
         reverse('trekking:trek_profile_svg',
                 kwargs={
                     'lang': get_language(),
                     'pk': obj.pk
                 }))
Ejemplo n.º 5
0
 def get_kml_url(self, obj):
     return build_url(
         self,
         reverse('trekking:trek_kml_detail',
                 kwargs={
                     'lang': get_language(),
                     'pk': obj.pk,
                     'slug': obj.slug
                 }))
Ejemplo n.º 6
0
 def get_thumbnail(self, obj):
     for picture in obj.pictures:
         return {
             'author': picture.author,
             'title': picture.title,
             'legend': picture.legend,
             'url': build_url(self, picture.attachment_file.url),
         }
     return {}
Ejemplo n.º 7
0
 def get_thumbnail(self, obj):
     thumbnailer = get_thumbnailer(obj.attachment_file)
     try:
         thumbnail = thumbnailer.get_thumbnail(aliases.get('small-square'))
     except (IOError, InvalidImageFormatError, DecompressionBombError):
         return ""
     thumbnail.author = obj.author
     thumbnail.legend = obj.legend
     return build_url(self, thumbnail.url)
Ejemplo n.º 8
0
 def get_photo_url(self, obj):
     return build_url(self, obj.photo_url) if obj.photo_url else ""
Ejemplo n.º 9
0
 def get_facebook_image_url(self, obj):
     return build_url(
         self, obj.facebook_image_url) if obj.facebook_image_url else ""