I have 2 tables products and catagories connected by foreign key. I need to update field products.new_cost using field catagorie
products
catagories
products.new_cost
catagorie
rows = Product.objects.filter(old_field__isnull=False) for row in rows: row.new_field = row.old_field.subfield Product.objects.bulk_update(rows, ['new_field'])