Adeodato Simó
0b87aacfce
pylint: enable useless-suppression
lint and perform cleanup
2024-07-27 03:47:35 -03:00
Adeodato Simó
29f852b57e
consolidate multiple cache.delete() calls into cache.delete_many()
2024-04-26 15:36:38 -03:00
Bart Schuurmans
e7f95ef4c2
Modify update_fields in save() when modifying objects
...
https://docs.djangoproject.com/en/5.0/releases/4.2/#setting-update-fields-in-model-save-may-now-be-required
2024-04-25 15:53:53 +02:00
Bart Schuurmans
0d621b68e0
Reorder operations in save() overrides
...
Accessing many-to-many relations before saving is no longer allowed.
Reorder all operations consistently:
1. Validations
2. Modify own fields
3. Perform save by calling super().save()
4. Modify related objects and clear caches
Especially clearing caches should be done after actually saving, otherwise the old data can be
re-added immediately by another request before the new data is written.
2024-04-25 10:12:30 +02:00
Bart Schuurmans
4f58b11330
Include the correct protocol and port in remote IDs
2024-04-24 15:35:19 +02:00
Mouse Reeve
73630331d1
Merge pull request #3299 from Minnozz/absorb
...
Track which Author/Work/Edition a duplicate has been merged into
2024-04-09 05:55:44 -05:00
Bart Schuurmans
4a690e675a
BookDataModel: add dry_run argument to merge_into
2024-03-23 19:28:57 +01:00
Bart Schuurmans
6f191acb27
BookDataModel: fix absorbing data from array and partial date fields
2024-03-23 19:28:57 +01:00
Bart Schuurmans
7066e2815b
BookDataModel.merge_into: return and log absorbed fields
2024-03-23 19:28:57 +01:00
Bart Schuurmans
5e123972e8
BookDataModel: implement merge_into method
2024-03-23 19:28:57 +01:00
Bart Schuurmans
b3753ab6da
Add MergedBookDataModel
2024-03-23 19:28:57 +01:00
Bart Schuurmans
0795b4d171
Include Author aliases in Book search vector
2024-03-23 19:26:51 +01:00
Adeodato Simó
b5805accac
Minor improvements to bookwyrm_book trigger code
...
- do not COALESCE columns that cannot be NULL
- do not bring bookwyrm_book to author names JOIN
- add comments documenting the four steps
2023-11-25 21:49:15 -03:00
Adeodato Simó
8df408e07e
Define search_vector_trigger
via Book.Meta.triggers
2023-11-25 17:02:54 -03:00
Adeodato Simó
e928027e16
Merge from main for up-to-date migrations
2023-11-09 14:00:14 -03:00
Mouse Reeve
116a838eef
Fixes typo that confuses isbn 10 and 13
2023-11-02 19:37:58 -07:00
Mouse Reeve
f839038c8f
Add test for normalizing isbns in book model
...
Turns out this was actually working as expected
2023-11-02 19:12:46 -07:00
Adeodato Simó
737ac8e908
Implement PartialDateField using SealedDate and a custom descriptor
2023-10-24 17:30:15 -03:00
Adeodato Simó
7cfdf235bc
Include author in cover image alt text
2023-09-25 16:03:16 -03:00
Mouse Reeve
1e0fe6d7c8
Remove duplicate if statement
2023-08-19 15:06:57 -07:00
Mouse Reeve
d9f6449767
Pre-populate sort title in edit book form if not provided
...
It's confusing to edit a book when this isn't set, so this provides the
best-guess version of the sort title if there isn't one provided, and
allows the user to change it as needed.
2023-08-06 17:57:57 -07:00
axiomizer
83ad45644b
Make hyphenated ISBN a property on the book model
2023-08-03 18:01:02 -04:00
Mouse Reeve
9d69f2fb3e
Merge pull request #2905 from bookwyrm-social/broken-editions
...
Adds management command to repair editions in bad state
2023-08-01 21:08:43 -07:00
Mouse Reeve
455b0c82ea
Fixes typo and outdated comment
2023-08-01 20:53:06 -07:00
Joeri de Ruiter
f07d7b02f1
Type annotations and related changes for bookwyrm.connectors
2023-07-28 17:43:32 +02:00
Mouse Reeve
ccf3a4c5c1
Skip trying to match editions
...
It's rare that it will be useful, and it was a huge hassle.
2023-07-18 19:33:39 -07:00
Mouse Reeve
8b88de624d
Adds test and fixes logic errors
2023-07-17 20:00:45 -07:00
Mouse Reeve
eee4e30e25
Adds managment command to repair editions in bad state
2023-07-17 11:22:59 -07:00
Zach Flanders
f43d7f8c70
fixing test and other checks
2023-04-25 21:00:16 -05:00
Zach Flanders
575e1bac4c
responding to review comments
2023-04-25 19:46:38 -05:00
Zach Flanders
a94a4732ec
add support for title sort to ignore initial article
2023-04-24 23:29:55 -05:00
Josh Soref
7ec56505ea
spelling: having a
...
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-04 20:02:54 -04:00
Mouse Reeve
dd2b166382
Revert "Add Website field to author"
2023-01-11 19:21:40 -08:00
Jascha Urbach
2d76595af6
Add Website field to author
...
Authors have Websites. that might be interesting for BookWyrm users. Now there is a field specify the website of an author and it is shown tu users under the wikipedia link
Adds max char for ISFDB ID (6) and ISNI (19 - 16 plus three -)
2022-12-28 15:41:48 +01:00
Christof Dorner
3e25b04e4a
Cache book_titleby only for 10 seconds
...
This should be enough caching when renderering pages like the feed, but
not so much that editing a book or author will not show the updated data.
At least without having to do some clever cache busting.
2022-12-20 21:48:16 +01:00
Jascha Urbach
ac8b060d58
Isfdb ID for books and authors ( #2482 )
...
* New ID: Audible ASIN
Audible belongs to Amazon BUT they do not share the same IDs. The Audible ASIN of an audiobook is never the same as the Amazon ASIN.
Yeah, I know, Amazon is great. The fact that the ASIN is a good distinction for different works and editions bothers me more than I will ever be willing to admint.
* New ID "ISFDB"
Internet Speculative Ficiton Database ID for books and authors.
Links to the entry if set.
* Added aasin to test
Added aasin to test
* the answer expects more emptxy fields...
2022-12-11 11:33:33 -08:00
Mouse Reeve
553f170f89
Only show editions with the author on the author page
2022-11-01 18:04:27 -07:00
Mouse Reeve
8d2da587d9
Prevent error when a book language has a null value
2022-05-16 11:06:11 -07:00
Mouse Reeve
a2c4dd4f9f
Updates migration and database fields
2022-02-17 08:25:01 -08:00
Mouse Reeve
c4b8e7949d
Add more book identifier fields
2022-01-30 11:41:31 -08:00
Mouse Reeve
4cc35ba25e
Cache query for author's books
2022-01-17 12:05:11 -08:00
Mouse Reeve
16a58ae079
Merge branch 'main' into book-file-links
2022-01-08 16:58:37 -08:00
Mouse Reeve
0da0091237
Cache title author snippet
2022-01-05 14:33:10 -08:00
Mouse Reeve
5c99f142f9
Serialize links for books
2021-12-15 17:12:53 -08:00
Mouse Reeve
86b294afd7
Re-structures link models
2021-12-15 16:23:21 -08:00
Mouse Reeve
a4859668b8
Merge branch 'main' into book-file-links
2021-12-15 10:05:29 -08:00
Mouse Reeve
2d875b5575
Add link properties for remotes
2021-12-05 12:29:54 -08:00
Mouse Reeve
e6a251fdad
Updates mocks across tests
2021-11-12 10:07:38 -08:00
Mouse Reeve
cef46a1827
Adds migration
2021-10-07 17:30:42 -07:00
Mouse Reeve
15105bda4f
Remove follow suggestion on request
2021-10-06 06:48:44 -07:00