mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2025-02-16 19:15:16 +00:00
Include book Readtrhough in the csv export
This commit is contained in:
parent
597378bb78
commit
db8c686dd3
1 changed files with 13 additions and 0 deletions
|
@ -54,6 +54,7 @@ class Export(View):
|
|||
fields = (
|
||||
["title", "author_text"]
|
||||
+ deduplication_fields
|
||||
+ ["start_date", "finish_date", "stopped_date"]
|
||||
+ ["rating", "review_name", "review_cw", "review_content"]
|
||||
)
|
||||
writer.writerow(fields)
|
||||
|
@ -70,6 +71,18 @@ class Export(View):
|
|||
|
||||
book.rating = review_rating.rating if review_rating else None
|
||||
|
||||
readthrough = (
|
||||
models.ReadThrough.objects.filter(
|
||||
user=request.user, book=book
|
||||
)
|
||||
.order_by("-finish_date")
|
||||
.first()
|
||||
)
|
||||
if readthrough:
|
||||
book.start_date = readthrough.start_date
|
||||
book.finish_date = readthrough.finish_date
|
||||
book.stopped_date = readthrough.stopped_date
|
||||
|
||||
review = (
|
||||
models.Review.objects.filter(
|
||||
user=request.user, book=book, content__isnull=False
|
||||
|
|
Loading…
Reference in a new issue