I'm working on an optimization problem that aims to display multiple solutions. This code is an additional constraint that prohibits returning the same solution. 
This is the output I get: `TypeError: 'builtin_function_or_method' object is not subscriptable`

I looked at multiple solutions, but they don't seem to work with my set up. Here are the two dictionaries:

```py
pref_dict[(c, d)] = int(preference[index_c][index_d])
assign = pulp.LpVariable.dicts("AssignTo", [(i, j) for i in worker for j in job], 0, 1, LpBinary)  

```

```py
while True:
    model.solve()
    print("Status:", LpStatus[model.status])
    if LpStatus[model.status] == "Optimal":
        for v in model.variables():
            if v.varValue > 0:
                answer = str(v).split("'")
                solutions.append((answer[1], answer[3]))
            with open('Solutions.csv', 'w', newline='') as myfile:
                writer = csv.writer(myfile)
                writer.writerows(solutions)
#this is the line that gives me issues:
        model += pulp.lpSum([pref_dict[(i, j)] * assign[(i, j)] for i in worker
                                                                for j in job
                                                                if value(vars[i][j]) == 1]) <= 80
    else:
        break

```