1
0
mirror of https://github.com/r4sas/py-i2phosts synced 2025-02-02 09:55:52 +00:00

pyi2phosts/postkey/admin.py: provide b32-link for preview

This commit is contained in:
Hidden Z 2010-11-05 15:06:30 +00:00
parent 8353439c5b
commit b268a3157d

View File

@ -1,10 +1,12 @@
from pyi2phosts.lib.utils import get_b32
from pyi2phosts.postkey.models import i2phost from pyi2phosts.postkey.models import i2phost
from pyi2phosts.postkey.models import PendingHost from pyi2phosts.postkey.models import PendingHost
from django.contrib import admin from django.contrib import admin
class i2phostAdmin(admin.ModelAdmin): class i2phostAdmin(admin.ModelAdmin):
def url(self, hostname): def url(self, hostname):
return '<a href=http://' + hostname.name + '>look</a>' return '<a href=http://' + get_b32(hostname.b64hash) + '>b32</a>'
url.allow_tags = True url.allow_tags = True
list_display = ('url', 'name', 'description', 'date_added', 'last_seen', 'expires', list_display = ('url', 'name', 'description', 'date_added', 'last_seen', 'expires',