Code

Ticket #8341: options.py

File options.py, 966 bytes (added by ciantic@…, 6 years ago)

Addition of can_delete and can_order

Line 
1Index: django/contrib/admin/options.py
2===================================================================
3--- django/contrib/admin/options.py     (revision 8365)
4+++ django/contrib/admin/options.py     (working copy)
5@@ -813,6 +813,8 @@
6     template = None
7     verbose_name = None
8     verbose_name_plural = None
9+    can_delete = True
10+    can_order = False
11 
12     def __init__(self, parent_model, admin_site):
13         self.admin_site = admin_site
14@@ -833,7 +835,8 @@
15         return inlineformset_factory(self.parent_model, self.model,
16             form=self.form, formset=self.formset, fk_name=self.fk_name,
17             fields=fields, formfield_callback=self.formfield_for_dbfield,
18-            extra=self.extra, max_num=self.max_num)
19+            extra=self.extra, max_num=self.max_num, can_delete=self.can_delete,
20+            can_order=self.can_order)
21 
22     def get_fieldsets(self, request, obj=None):
23         if self.declared_fieldsets: