Ticket #9338: can_order_r15376.patch

File can_order_r15376.patch, 1.4 KB (added by Mathijs de Bruin, 14 years ago)

Partial (and broken) work on a patch for r15376

  • options.py

     
    343343        if self.prepopulated_fields:
    344344            js.append('js/urlify.js')
    345345            js.append('js/prepopulate.min.js')
     346           
     347        #import pdb; pdb.set_trace()
     348       
    346349        if self.opts.get_ordered_objects():
    347350            js.extend(['js/getElementsBySelector.js', 'js/dom-drag.js' , 'js/admin/ordering.js'])
    348351
     
    12721275    verbose_name = None
    12731276    verbose_name_plural = None
    12741277    can_delete = True
     1278    can_order = False
    12751279
    12761280    def __init__(self, parent_model, admin_site):
    12771281        self.admin_site = admin_site
     
    12821286            self.verbose_name = self.model._meta.verbose_name
    12831287        if self.verbose_name_plural is None:
    12841288            self.verbose_name_plural = self.model._meta.verbose_name_plural
     1289        if self.opts.get_ordered_objects():
     1290            self.can_order = True           
    12851291
     1292
    12861293    def _media(self):
    12871294        from django.conf import settings
    12881295        js = ['js/jquery.min.js', 'js/jquery.init.js', 'js/inlines.min.js']
     
    13191326            "extra": self.extra,
    13201327            "max_num": self.max_num,
    13211328            "can_delete": self.can_delete,
     1329            "can_order": self.can_order
    13221330        }
    13231331        defaults.update(kwargs)
    13241332        return inlineformset_factory(self.parent_model, self.model, **defaults)
Back to Top