58
+        return img_url(self.m_photo_path)
57 59
 
58 60
     @property
59 61
     def l_photo_url(self):
60
-        return u'{0}/{1}'.format(settings.IMG_DOMAIN, self.l_photo_path) if self.l_photo_path else ''
62
+        return img_url(self.l_photo_path)
61 63
 
62 64
     @property
63 65
     def r_photo_url(self):
64
-        return u'{0}/{1}'.format(settings.IMG_DOMAIN, self.r_photo_path) if self.r_photo_path else ''
66
+        return img_url(self.r_photo_path)
65 67
 
66 68
     @property
67 69
     def data(self):

+ 7 - 0
utils/url_utils.py

@@ -0,0 +1,7 @@
1
+# -*- coding: utf-8 -*-
2
+
3
+from django.conf import settings
4
+
5
+
6
+def img_url(img_path):
7
+    return u'{0}/{1}'.format(settings.IMG_DOMAIN, img_path) if img_path else ''

pai2 - Gogs: Go Git Service

拍爱

Brightcells: afd07e5389 Add api box_program_version_api 9 ans auparavant
..
migrations 4defb80fdc gogs first init 10 ans auparavant
__init__.py 4defb80fdc gogs first init 10 ans auparavant
admin.py fabef63211 set line_length=200 for isort 10 ans auparavant
models.py fabef63211 set line_length=200 for isort 10 ans auparavant
tests.py fabef63211 set line_length=200 for isort 10 ans auparavant
urls.py afd07e5389 Add api box_program_version_api 9 ans auparavant
views.py fabef63211 set line_length=200 for isort 10 ans auparavant