コード例 #1
0
ファイル: models.py プロジェクト: arthurfurlan/django-shortim
 def get_short_url(self):
     code = SequenceMapper.from_decimal(self.id)
     return '/' + code
コード例 #2
0
ファイル: models.py プロジェクト: arthurfurlan/django-shortim
    def get_absolute_url(self):
        if not self.id and self.is_local_url():
            return self.url

        code = SequenceMapper.from_decimal(self.id)
        return ('shortim_preview', (), {'code':code})
コード例 #3
0
ファイル: models.py プロジェクト: arthurfurlan/django-shortim
 def get_qrcode_url(self):
     code = SequenceMapper.from_decimal(self.id)
     if SHORTIM_QRCODE_URL:
         return SHORTIM_QRCODE_URL % code
     else:
         return os.path.join(settings.MEDIA_URL, SHORTIM_QRCODE_DIR, code + '.png')
コード例 #4
0
ファイル: models.py プロジェクト: arthurfurlan/django-shortim
 def get_qrcode_path(self):
     code = SequenceMapper.from_decimal(self.id)
     return os.path.join(settings.MEDIA_ROOT, SHORTIM_QRCODE_DIR, code + '.png')
コード例 #5
0
 def get_short_url(self):
     code = SequenceMapper.from_decimal(self.id)
     return '/' + code
コード例 #6
0
    def get_absolute_url(self):
        if not self.id and self.is_local_url():
            return self.url

        code = SequenceMapper.from_decimal(self.id)
        return ('shortim_preview', (), {'code': code})