Update sort of GenericImage queryset
UPDATE "area_genericimage" SET "sort" = CASE WHEN "id" = 40964 THEN 1 WHEN "id" = 40965 THEN 2 END WHERE "area_genericimage"."id" in (40964, 40965)