Ticket #9308: fix_delete.diff

File fix_delete.diff, 718 bytes (added by Bob Thomas, 10 years ago)

Fix regression from 7778, set FK to null

  • django/db/models/query.py

     
    852852        update_query = sql.UpdateQuery(cls, connection)
    853853        for field, model in cls._meta.get_fields_with_model():
    854854            if (field.rel and field.null and field.rel.to in seen_objs and
    855                     filter(lambda f: f.column == field.column,
     855                    filter(lambda f: f.column == field.rel.get_related_field().name,
    856856                    field.rel.to._meta.fields)):
    857857                if model:
    858858                    sql.UpdateQuery(model, connection).clear_related(field,
Back to Top