Ticket #1014: patch.diff
File patch.diff, 1.3 KB (added by , 19 years ago) |
---|
-
C:/Program
984 984 985 985 def method_save(opts, self): 986 986 # Run any pre-save hooks. 987 cont = True 987 988 if hasattr(self, '_pre_save'): 988 self._pre_save() 989 cont = self._pre_save() 990 #If function returned a value which is False stop saving 991 if not cont and cont is not None: 992 return 989 993 non_pks = [f for f in opts.fields if not f.primary_key] 990 994 cursor = db.db.cursor() 991 995 … … 1034 1038 def method_delete(opts, self): 1035 1039 assert getattr(self, opts.pk.attname) is not None, "%r can't be deleted because it doesn't have an ID." 1036 1040 # Run any pre-delete hooks. 1041 cont = True 1037 1042 if hasattr(self, '_pre_delete'): 1038 self._pre_delete() 1043 cont = self._pre_delete() 1044 #If function returned a value which is False stop saving 1045 if not cont and cont is not None: 1046 return 1039 1047 cursor = db.db.cursor() 1040 1048 for related in opts.get_all_related_objects(): 1041 1049 rel_opts_name = related.get_method_name_part()