model - propagate new default value to old Django objects -


i added default value 1 of fields of 1 of models in django site. objects of type existed before set default have null value field. new default value set propagated backwards onto of objects existed before set default value. how can this?

just run update query:

mymodel.objects.filter(myfield__isnull=true).update(myfield=new_value) 

Comments

Popular posts from this blog

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -

java - JavaFX 2 slider labelFormatter not being used -