Browse Source

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

pull/1/head
Hidden Z 14 years ago
parent
commit
b268a3157d
  1. 4
      pyi2phosts/postkey/admin.py

4
pyi2phosts/postkey/admin.py

@ -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',

Loading…
Cancel
Save