Commit 7f51e9e8 authored by xaingling's avatar xaingling

fix api help text error

parent 037a711e
from django.urls import reverse
from django.urls import reverse, get_script_prefix, get_resolver, get_urlconf
from django.db.models import Q
......@@ -7,9 +7,11 @@ def make_edit_link(instance):
link = reverse('admin:{}_{}_change'.format(opt.app_label, opt.model_name), args=(instance.id,))
return link
def make_add_link(instance):
opt = instance._meta
link = reverse('admin:{}_{}_add'.format(opt.app_label, opt.model_name))
print("script_prefix", get_script_prefix())
return link
......
......@@ -240,7 +240,7 @@ class ImageInline(admin.StackedInline):
def image_tag(self, obj):
u = mark_safe('<img src="{url}" width="150" height="150" />'.format(
url= obj.picture.url))
url=obj.picture.url))
return u
......@@ -271,9 +271,9 @@ class PlatformDeploymentAdmin(admin.ModelAdmin):
('platform__name', DropdownFilter),
PlatformDeploymentHasNumber)
# inlines = [
# ImageInline,
# ]
inlines = [
ImageInline,
]
admin.site.register(PlatformDeployment, PlatformDeploymentAdmin)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment