Let's define the model as m:
m = Model('AnyName')
Now the constraint can be added to the model:
m.addConstrs((xVar.sum('*',i) <= 10 for i in A, j in B, i<>j), "constraintName")
Source: https://www.gurobi.com/documentation/8.1/quickstart_mac/py_netflow_py_example.html