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
Post a Comment