Ejemplo n.º 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),
     })
Ejemplo n.º 2
0
 def http_puchi_awakened_url(self):
     return get_http_image_url(self.puchi_awakened)
Ejemplo n.º 3
0
 def http_puchi_url(self):
     return get_http_image_url(self.puchi)
Ejemplo n.º 4
0
 def http_icon_awakened_url(self):
     return get_http_image_url(self.icon_awakened)
Ejemplo n.º 5
0
 def http_icon_url(self):
     return get_http_image_url(self.icon)
Ejemplo n.º 6
0
 def http_transparent_awakened_url(self):
     return get_http_image_url(self.transparent_awakened)
Ejemplo n.º 7
0
 def http_transparent_url(self):
     return get_http_image_url(self.transparent)
Ejemplo n.º 8
0
 def http_art_hd_awakened_url(self):
     return get_http_image_url(self.art_hd_awakened)
Ejemplo n.º 9
0
 def http_art_url(self):
     return get_http_image_url(self.art)