Ticket #1331: magic_removal-manytomany_flatten_data_fix.diff
File magic_removal-manytomany_flatten_data_fix.diff, 709 bytes (added by , 19 years ago) |
---|
-
db/models/fields/related.py
409 409 def flatten_data(self, follow, obj = None): 410 410 new_data = {} 411 411 if obj: 412 get_list_func = getattr(obj, 'get_%s_list' % self.rel.singular) 413 instance_ids = [instance._get_pk_val() for instance in get_list_func()] 412 instance_ids = [instance._get_pk_val() for instance in getattr(obj, self.name).all()] 414 413 if self.rel.raw_id_admin: 415 414 new_data[self.name] = ",".join([str(id) for id in instance_ids]) 416 415 else: