I have made a custom formwizard and incorporated it into my admin interface.
Basically I have taken the change_form.html and left it under the admin interface url:
(r'^admin/compilation/evaluation/add/$', EvaluationWizard([EvaluationForm1, EvaluationForm2])),
It works, but the admin “session” is not kept. I can access the page without being logged in to the admin interface, and the admin variables like the breadcrumbs are not working.
How do I incorporate it under the “admin interface session” so to speak?
Thanks,
John
If you need to make sure only authorised users access the page, you need to check for an admin user in your request handler. This will be the
__call__method in your EvaluationWizard class.Basically, the logic used by the admin is available for viewing here. Look for this in the
AdminSiteclass:and use similar logic, or whatever you need. You’ll need a similar statement at the top of your
__call__method. Thehas_permissionmethod ofAdminSiteis a one-liner, which you can use as-is, but you’ll need to adapt theloginmethod to your specific needs.