I need some help redirecting a view back to the form where it was initiated.
To explain: because of the complexities of validation I've written
an independent python batch loader for my Document data model which is a
member of my Poetry app.
I've overridden the ADD (record) button for the model with a template file &
named it change_list.html so that the contents look like this:
{% extends "admin/change_list.html" %}
{% load i18n admin_static admin_list %}
{% block object-tools-items %}
{% if has_add_permission %}
<li>
<!-- <a href="/batchload" class="addlink"> -->
{% blocktrans with cl.opts.verbose_name as name %}Select & batch load {{ name }}s{% endblocktrans %}
</a>
</li>
{% endif %}
{% endblock %}
To get the batch load to work I've put this change_list.html file in the sub-dir
Everything works OK ... EXCEPT
When clicking on the Select & batch load documents
the batch load runs fine except when it finishes and returns to
execute the render statement I get this error:
I have two questions:
What am I doing wrong?
And is there a better way to do this?
PS In future it would be better to copy & paste the actual text of the error trace, rather than screenshot. This makes it searchable by "the next guy"....
I'm using Python 3.6, Django 2.0.4 and Suit 2.0a1
I need some help redirecting a view back to the form where it was initiated.
To explain: because of the complexities of validation I've written an independent python batch loader for my Document data model which is a member of my Poetry app.
I've overridden the ADD (record) button for the model with a template file & named it change_list.html so that the contents look like this:
To get the batch load to work I've put this change_list.html file in the sub-dir
templates/admin/poetry/document/
I've added the line:
to the: class DocumentAdmin(admin.ModelAdmin):
I've added to my urls the line:
In my poety/views.py file I have added:
Everything works OK ... EXCEPT When clicking on the Select & batch load documents the batch load runs fine except when it finishes and returns to execute the render statement I get this error:
I have two questions:
What am I doing wrong? And is there a better way to do this?
In anticipation thanks for any help.