def get_readonly_fields(self, request, obj=None):
        if obj:  # In edit mode
            # only sysadmin can change team accountable for a database
            if request.user.has_perm(self.perm_add_database_infra):
                return ('name', 'databaseinfra', ) + self.readonly_fields
            else:
                return ('name', 'databaseinfra', 'team',) + self.readonly_fields
        return self.readonly_fields
Typecast and optionally utilize callbacks for the given argument.
dataset/ETHPy150Open globocom/database-as-a-service/dbaas/logical/admin/database.py/DatabaseAdmin.get_readonly_fields--crossover with--dataset/ETHPy150Open marrow/script/marrow/script/core.py/Parser.transform