コード例 #1
0
 def cached_idol(self):
     if not self._cache_idol_last_update or self._cache_idol_last_update < timezone.now(
     ) - datetime.timedelta(days=self._cache_idol_days):
         self.force_cache_idol()
     return AttrDict({
         'pk':
         self.idol_id,
         'id':
         self.idol_id,
         'name':
         self._cache_idol_name,
         'japanese_name':
         self._cache_idol_japanese_name,
         'i_type':
         self._cache_idol_i_type,
         'type':
         TYPE_DICT[self._cache_idol_i_type]
         if self._cache_idol_i_type is not None else None,
         'english_type':
         ENGLISH_TYPE_DICT[self._cache_idol_i_type]
         if self._cache_idol_i_type is not None else None,
         'image':
         self._cache_idol_image,
         'image_url':
         get_image_url(self._cache_idol_image),
         'http_image_url':
         get_http_image_url(self._cache_idol_image),
         'item_url':
         u'/idol/{}/{}/'.format(self.idol_id,
                                tourldash(self._cache_idol_name)),
         'ajax_item_url':
         u'/ajax/idol/{}/'.format(self.idol_id),
     })
コード例 #2
0
 def http_puchi_awakened_url(self):
     return get_http_image_url(self.puchi_awakened)
コード例 #3
0
 def http_puchi_url(self):
     return get_http_image_url(self.puchi)
コード例 #4
0
 def http_icon_awakened_url(self):
     return get_http_image_url(self.icon_awakened)
コード例 #5
0
 def http_icon_url(self):
     return get_http_image_url(self.icon)
コード例 #6
0
 def http_transparent_awakened_url(self):
     return get_http_image_url(self.transparent_awakened)
コード例 #7
0
 def http_transparent_url(self):
     return get_http_image_url(self.transparent)
コード例 #8
0
 def http_art_hd_awakened_url(self):
     return get_http_image_url(self.art_hd_awakened)
コード例 #9
0
 def http_art_url(self):
     return get_http_image_url(self.art)