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_example_object('').model._meta
18 help_text = _('''Context:<br>
19 <code>{{ %(model_name)s }}</code> – a <a href="%(docs_url)s">%(verbose_name)s</a> object.<br>
20 You can put it in in the fields <em>Subject</em> and <em>Body</em> using dot notation, like this:<br>
21 <code>{{ %(model_name)s.id }}</code>.''') % {
22 'model_name': meta.model_name,
23 'docs_url': reverse('django-admindocs-models-detail', args=(meta.app_label, meta.model_name)),
24 'verbose_name': meta.verbose_name,