mirror of
https://github.com/evennia/evennia.git
synced 2026-03-20 14:56:30 +01:00
Fix the save and continue editing option
This commit is contained in:
parent
ae0b4bad55
commit
7bd7b91b93
1 changed files with 12 additions and 0 deletions
|
|
@ -103,6 +103,11 @@ class ObjectDBAdmin(admin.ModelAdmin):
|
|||
)}),
|
||||
)
|
||||
|
||||
def get_urls(self):
|
||||
urls = super(ObjectDBAdmin, self).get_urls()
|
||||
print urls
|
||||
return urls
|
||||
|
||||
def get_fieldsets(self, request, obj=None):
|
||||
"""
|
||||
Return fieldsets.
|
||||
|
|
@ -154,5 +159,12 @@ class ObjectDBAdmin(admin.ModelAdmin):
|
|||
obj.at_object_creation()
|
||||
obj.at_init()
|
||||
|
||||
def response_add(self, request, obj, post_url_continue=None):
|
||||
if '_continue' in request.POST:
|
||||
from django.http import HttpResponseRedirect
|
||||
from django.core.urlresolvers import reverse
|
||||
return HttpResponseRedirect(reverse("admin:objects_objectdb_change", args=[obj.id]))
|
||||
return super(ObjectDBAdmin, self).response_add(request, obj, post_url_continue)
|
||||
|
||||
|
||||
admin.site.register(ObjectDB, ObjectDBAdmin)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue