Question: (This question is similar to [Should ARIA labels provide context?](https://stackoverflow.com/questions/39284454/should-aria-labels-provide-context), but not identical, as I'm talking about buttons and do not have full control over the markup.)

I have some amount of items and buttons that act on those items. Here's a simplified example:

```html
<ul>
    <li><span>Item: foo</span> <button>remove</button></li>
    <li><span>Item: bar</span> <button>remove</button></li>
    <li><span>Item: baz</span> <button>remove</button></li>
</ul>

```

As far as I understand, when someone using a screen reader tabs through the page, they will be read the button text but not the item text. This doesn't seem ideal to me, as they don't have context on which item the button will remove.

Assume that I don't have full control of the markup; I can only add attributes.

What is the best practice in this situation?

* add an `aria-label` to the button that gives more context:

```html
<button aria-label="Remove item foo">remove</button>

```
* make the item text itself tabbable and give it an `aria-label` so it's read aloud:

```html
<span tabindex="0" aria-label="Item foo">Item: foo</span>

```
* leave things as they are, because this is intended behavior and/or I'm misunderstanding something about screen readers
* something else entirely?

Answer: 
You can certainly use `prefetch_related()` to make the query more efficient, but the reason that your code is slow is because you have DB calls nested within a forloop. You can re-write your queries to essentially do the if-statement and for-loop logic:

```py
def my_view(self):
    ...

    # move your if-statement to the model filter
    records = Mymodel.objects.filter(
        due_date=due_date,
        send_email=True
    ).prefetch_related('assignees')

    # loop through each record (is this necessary?)
    for record in records:
        # get a list of email addresses
        responsible_emails = rec.assignees.values_list('email', flat=True)

```
You can query from the `UserModel` itself like this.

```
due_date = datetime.date.today()
UserModel.objects.prefetch_related("tasks").filter(
    tasks__send_email=True, tasks__due_date=due_date
).values_list("email", flat=True)

```