Ticket #9338: can_order_r15376.patch
File can_order_r15376.patch, 1.4 KB (added by , 14 years ago) |
---|
-
options.py
343 343 if self.prepopulated_fields: 344 344 js.append('js/urlify.js') 345 345 js.append('js/prepopulate.min.js') 346 347 #import pdb; pdb.set_trace() 348 346 349 if self.opts.get_ordered_objects(): 347 350 js.extend(['js/getElementsBySelector.js', 'js/dom-drag.js' , 'js/admin/ordering.js']) 348 351 … … 1272 1275 verbose_name = None 1273 1276 verbose_name_plural = None 1274 1277 can_delete = True 1278 can_order = False 1275 1279 1276 1280 def __init__(self, parent_model, admin_site): 1277 1281 self.admin_site = admin_site … … 1282 1286 self.verbose_name = self.model._meta.verbose_name 1283 1287 if self.verbose_name_plural is None: 1284 1288 self.verbose_name_plural = self.model._meta.verbose_name_plural 1289 if self.opts.get_ordered_objects(): 1290 self.can_order = True 1285 1291 1292 1286 1293 def _media(self): 1287 1294 from django.conf import settings 1288 1295 js = ['js/jquery.min.js', 'js/jquery.init.js', 'js/inlines.min.js'] … … 1319 1326 "extra": self.extra, 1320 1327 "max_num": self.max_num, 1321 1328 "can_delete": self.can_delete, 1329 "can_order": self.can_order 1322 1330 } 1323 1331 defaults.update(kwargs) 1324 1332 return inlineformset_factory(self.parent_model, self.model, **defaults)