Filter records according to zone (user table field) user

Hello,
Sorry I’ve been a bit absent these days. Have you been able to find anything about it?

Notice how this is almost identical to the problem you got earlier with a different usage of instance. It’s the same issue that is solved in basically the same way.

What do you think the solution may be?

Something like that
[instance].['url'] = reverse('aprobar_reclamacion', args=[instance['id']])

although I don’t know…

You’re close. Going back to an earlier reply.

The variable instance used to be an object. So we used to refer to the member attribute id as instance.id. It (instance) is now a dict. So we replaced instance.id with instance['id'].

So, same situation, we used to be able to refer to instance.url. But now that instance is a dict and not an object, how might we refer to the url entry in the dict named instance?

with instance.[url] ??

If I have:

a_dict = { 'key_1': 'value_1', 'key_2': 'value_2', 'key_3': 'value_3' }

How do I get the value for the key key_2 from that dict?

It would be like a for loop

Actually it wouldn’t. Review the docs at 5. Data Structures — Python 3.11.3 documentation

I have not understood very well but it could be something like this:
a_dict ['key_2']

You are 100% correct here.

Now apply that to the most recent issue you’re encountering above.

Side note: You really do want to become extremely familiar with all of Python’s native data structures. Understanding them and how to use them is critical if you wish to become proficient with Django.