2 from django.http import JsonResponse
3 from django.urls import reverse
4 from django.shortcuts import render
5 from django.utils.translation import ugettext as _
6 from .states import states
9 def state_info(request, slug):
11 if state.slug == slug:
14 return JsonResponse({})
16 meta = state().get_objects().model._meta
19 help_text = _('''Context:<br>
20 <code>{{ %(model_name)s }}</code> – a <a href="%(docs_url)s">%(verbose_name)s</a> object.<br>
21 You can put it in in the fields <em>Subject</em> and <em>Body</em> using dot notation, like this:<br>
22 <code>{{ %(model_name)s.id }}</code>.''') % {
23 'model_name': meta.model_name,
24 'docs_url': reverse('django-admindocs-models-detail', args=(meta.app_label, meta.model_name)),
25 'verbose_name': meta.verbose_name,