Comment

Chris Foresman

I came to say the same; at the very least this would be much cleaner.

```
def f4(a):
    names = Song.objects.filter(artist=a).values_list("name", flat=True):
    return hashlib.md5("".join(list(names)).encode("utf-8")).hexdigest()
```

Parent comment

Paulo Almeida

You don't need the for loop, right? You can pass the django query directly to ''.join.

Replies

Peter Bengtsson

That is no different. Just styled differently.