Commits

Dmitri Lebedev committed a1bc23f

dash instead of dot

  • Participants
  • Parent commits bf78a37

Comments (0)

Files changed (2)

example/django_inline/templatetags/inline.py

 def editable_id(obj, field_name):
     class_name = obj.__class__.__name__
     app_label = obj._meta.app_label
-    return '%s.%s.%s.%s' % (app_label, class_name, obj.pk, field_name)
+    return '%s-%s-%s-%s' % (app_label, class_name, obj.pk, field_name)

example/django_inline/views.py

                 break
         
         try:
-            app_label, class_name, pk, field_name = id.split('.')
+            app_label, class_name, pk, field_name = id.split('-')
         except ValueError:  # if the number of items in the string is wrong
             _raise_error(id)
 
         value = admin.site._registry[obj.__class__].get_form(obj.pk).base_fields[field_name]
 
     return render_to_response(templates_list('inline-form.html', obj), {
-        'form': Form(initial={'id': id, 'data': getattr(obj, field_name)}),
+        'form': Form(initial={'id': id, 'value': getattr(obj, field_name)}),
         'obj': obj,
         'field': field_name,
     }, context_instance=RequestContext(request))