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:
parent
8353439c5b
commit
b268a3157d
@ -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…
x
Reference in New Issue
Block a user