﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
26080	Add field.on_delete to all relational fields	Sven R. Kunze	nobody	"We still upgrade from 1.7 to 1.8 and replace all legacy API with get_fields().

Please consider the following loop:

{{{
for field in User._meta.get_fields():
    if not field.is_relation:
        continue
    if field.on_delete != models.CASCADE:
        continue
    # do what's necessary
}}}

We've noticed field has not on_delete in all cases.

Wouldn't it make sense to have an {{{ on_delete }}} attribute always available all the time **if the field is a relation** (even if it's None)?

Right now, we need to check for {{{ hasattr(field, 'on_delete') }}}."	Cleanup/optimization	closed	Database layer (models, ORM)	1.8	Normal	wontfix		tzanke@…	Unreviewed	0	0	0	0	0	0
