forked from mirrors/bookwyrm
Use values_list with flat, yay!
This commit is contained in:
parent
3aa159bc89
commit
7f5d47a36f
1 changed files with 5 additions and 5 deletions
|
@ -56,12 +56,12 @@ class Command(BaseCommand):
|
|||
self.stdout.write(" OK 🖼")
|
||||
|
||||
# Books
|
||||
book_ids = [
|
||||
values["id"]
|
||||
for values in models.Book.objects.select_subclasses()
|
||||
book_ids = (
|
||||
models.Book.objects.select_subclasses()
|
||||
.filter()
|
||||
.values("id")
|
||||
]
|
||||
.values_list("id", flat=True)
|
||||
)
|
||||
|
||||
self.stdout.write(
|
||||
" → Book preview images ({}): ".format(len(book_ids)), ending=""
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue