class MansInlineAdmin(admin.TabularInline):
model = Man
@admin.register(Company)
class CompanyAdmin(admin.ModelAdmin):
fields = ['name']
list_display = ['name']
ordering = ['name']
inlines = [MansInlineAdmin]
<?php
$dsn = "mysql:host=localhost;dbname=mydb";
$user = "user12";
$passwd = "12user";
$pdo = new PDO($dsn, $user, $passwd);
$pdo->query("UPDATE mytable
SET balance =
(
CASE
WHEN user_group = 3 THEN balance + 10
WHEN user_group = 4 THEN balance + 40
END
)");