Ticket #494: 494.patch
File 494.patch, 4.2 KB (added by , 17 years ago) |
---|
-
django/db/models/fields/related.py
17 17 from sets import Set as set # Python 2.3 fallback 18 18 19 19 # Values for Relation.edit_inline. 20 TABULAR, STACKED = 1, 220 TABULAR, STACKED = 'inline_tabular ', 'inline_stacked ' 21 21 22 22 RECURSIVE_RELATIONSHIP_CONSTANT = 'self' 23 23 -
django/contrib/admin/templatetags/admin_modify.py
166 166 def render(self, context): 167 167 relation = self.rel_var.resolve(context) 168 168 context.push() 169 if relation.field.rel.edit_inline == models.TABULAR: 169 edit_inline = relation.field.rel.edit_inline 170 if edit_inline.startswith(models.TABULAR): 170 171 bound_related_object_class = TabularBoundRelatedObject 171 elif relation.field.rel.edit_inline == models.STACKED: 172 edit_inline = edit_inline[len(models.TABULAR):] 173 elif edit_inline.startswith(models.STACKED): 172 174 bound_related_object_class = StackedBoundRelatedObject 175 edit_inline = edit_inline[len(models.STACKED):] 173 176 else: 174 177 bound_related_object_class = relation.field.rel.edit_inline 175 178 original = context.get('original', None) 176 179 bound_related_object = relation.bind(context['form'], original, bound_related_object_class) 177 180 context['bound_related_object'] = bound_related_object 181 context['extra_classes'] = edit_inline 178 182 t = loader.get_template(bound_related_object.template_name()) 179 183 output = t.render(context) 180 184 context.pop() -
django/contrib/admin/templates/admin/edit_inline_stacked.html
1 1 {% load admin_modify %} 2 <fieldset class="module aligned ">2 <fieldset class="module aligned {{extra_classes}}"> 3 3 {% for fcw in bound_related_object.form_field_collection_wrappers %} 4 4 <h2>{{ bound_related_object.relation.opts.verbose_name|capfirst }} #{{ forloop.counter }}</h2> 5 5 {% if bound_related_object.show_url %}{% if fcw.obj.original %} -
django/contrib/admin/templates/admin/edit_inline_tabular.html
1 1 {% load admin_modify %} 2 <fieldset class="module ">2 <fieldset class="module {{extra_classes}}"> 3 3 <h2>{{ bound_related_object.relation.opts.verbose_name_plural|capfirst }}</h2><table> 4 4 <thead><tr> 5 5 {% for fw in bound_related_object.field_wrapper_list %} -
docs/model-api.txt
818 818 interface. Use either ``models.TABULAR`` or ``models.STACKED``, 819 819 which, respectively, designate whether the inline-editable 820 820 objects are displayed as a table or as a "stack" of 821 fieldsets. 821 fieldsets. You can append a string specifying extra CSS 822 classes to be used for the inline fieldsets; the ``collapse`` 823 and ``wide`` classes, documented below, are useful. 824 For example: 822 825 826 edit_inline = models.TABULAR + 'collapse' 827 823 828 ``limit_choices_to`` A dictionary of lookup arguments and values (see 824 829 the `Database API reference`_) that limit the 825 830 available admin choices for this object. Use this