aboutsummaryrefslogtreecommitdiff
path: root/apps/utils/widgets.py
diff options
context:
space:
mode:
Diffstat (limited to 'apps/utils/widgets.py')
-rw-r--r--apps/utils/widgets.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/apps/utils/widgets.py b/apps/utils/widgets.py
index 2745932..6dc28bf 100644
--- a/apps/utils/widgets.py
+++ b/apps/utils/widgets.py
@@ -142,10 +142,12 @@ class RelatedFieldWidgetCanAdd(widgets.Select):
rel_to = related_model
info = (rel_to._meta.app_label, rel_to._meta.object_name.lower())
related_url = 'admin:%s_%s_add' % info
+ print(related_url)
self.related_url = related_url
def render(self, name, value, *args, **kwargs):
self.related_url = reverse(self.related_url)
+ print(self.related_url)
output = [super(RelatedFieldWidgetCanAdd, self).render(name, value, *args, **kwargs)]
output.append('<a class="circle plus small-circle modal-open" href="%s" id="add_id_%s" data-modal-hed-class="%s" data-modal-hed="Add a New %s">New</a>' % (self.related_url, name, name, name.capitalize()))
return mark_safe(u''.join(output))