Ticket #2328: diff_follow_in_admin.txt

File diff_follow_in_admin.txt, 782 bytes (added by marcink@…, 9 years ago)
Line 
1Index: contrib/admin/views/main.py
2===================================================================
3--- contrib/admin/views/main.py (revision 3332)
4+++ contrib/admin/views/main.py (working copy)
5@@ -313,7 +316,14 @@
6         return add_stage(request, app_label, model_name, form_url='../../add/')
7 
8     try:
9-        manipulator = model.ChangeManipulator(object_id)
10+        follow = {}
11+        for f in opts.fields:
12+            follow[f.name] = False
13+        for field_list in [fieldset[1]['fields'] for fieldset in opts.admin.fields]:
14+            for field_name in field_list:
15+                follow[field_name] = True
16+        print follow
17+        manipulator = model.ChangeManipulator(object_id, follow=follow)
18     except ObjectDoesNotExist:
19         raise Http404
20 
Back to Top