Ticket #10595: patch_django_10595.20090324.diff
File patch_django_10595.20090324.diff, 3.0 KB (added by , 16 years ago) |
---|
-
django/contrib/admin/options.py
207 207 for inline_class in self.inlines: 208 208 inline_instance = inline_class(self.model, self.admin_site) 209 209 self.inline_instances.append(inline_instance) 210 if 'action_checkbox' not in self.list_display :210 if 'action_checkbox' not in self.list_display and self.actions is not None: 211 211 self.list_display = ['action_checkbox'] + list(self.list_display) 212 212 if not self.list_display_links: 213 213 for name in self.list_display: … … 421 421 """ 422 422 actions = {} 423 423 for klass in [self.admin_site] + self.__class__.mro()[::-1]: 424 for action in getattr(klass, 'actions', []): 424 class_actions = getattr(klass, 'actions', []) 425 if not class_actions: 426 continue # avoid iteration over None value 427 for action in class_actions: 425 428 func, name, description = self.get_action(action) 426 429 actions[name] = (func, name, description) 427 430 return actions … … 948 951 media = self.media 949 952 950 953 # Build the action form and populate it with available actions. 951 action_form = self.action_form(auto_id=None) 952 action_form.fields['action'].choices = self.get_action_choices(request) 954 if self.actions is None: 955 action_form = False 956 actions_on_top = False 957 actions_on_bottom = False 958 else: 959 action_form = self.action_form(auto_id=None) 960 action_form.fields['action'].choices = self.get_action_choices(request) 961 actions_on_top = self.actions_on_top 962 actions_on_bottom = self.actions_on_bottom 953 963 954 964 context = { 955 965 'title': cl.title, … … 960 970 'root_path': self.admin_site.root_path, 961 971 'app_label': app_label, 962 972 'action_form': action_form, 963 'actions_on_top': self.actions_on_top,964 'actions_on_bottom': self.actions_on_bottom,973 'actions_on_top': actions_on_top, 974 'actions_on_bottom': actions_on_bottom, 965 975 } 966 976 context.update(extra_context or {}) 967 977 return render_to_response(self.change_list_template or [ -
django/contrib/admin/templates/admin/change_list.html
9 9 <script type="text/javascript" src="../../jsi18n/"></script> 10 10 {% endif %} 11 11 {{ media }} 12 {% if not actions_on_top and not actions_on_bottom %} 13 <style> 14 #changelist table thead th:first-child {width: inherit} 15 </style> 16 {% endif %} 12 17 {% endblock %} 13 18 14 19 {% block bodyclass %}change-list{% endblock %}