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 🖼")
|
self.stdout.write(" OK 🖼")
|
||||||
|
|
||||||
# Books
|
# Books
|
||||||
book_ids = [
|
book_ids = (
|
||||||
values["id"]
|
models.Book.objects.select_subclasses()
|
||||||
for values in models.Book.objects.select_subclasses()
|
|
||||||
.filter()
|
.filter()
|
||||||
.values("id")
|
.values_list("id", flat=True)
|
||||||
]
|
)
|
||||||
|
|
||||||
self.stdout.write(
|
self.stdout.write(
|
||||||
" → Book preview images ({}): ".format(len(book_ids)), ending=""
|
" → Book preview images ({}): ".format(len(book_ids)), ending=""
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue