diff --git a/fedireads/books_manager.py b/fedireads/books_manager.py index 31f5c785..0821269e 100644 --- a/fedireads/books_manager.py +++ b/fedireads/books_manager.py @@ -29,7 +29,6 @@ def load_more_data(book_id): connector.expand_book_data(book) - def search(query): ''' try an external datasource for books ''' connector = get_connector() diff --git a/fedireads/forms.py b/fedireads/forms.py index fccfe74f..eea57c93 100644 --- a/fedireads/forms.py +++ b/fedireads/forms.py @@ -78,9 +78,9 @@ class CoverForm(ModelForm): help_texts = {f: None for f in fields} -class BookForm(ModelForm): +class EditionForm(ModelForm): class Meta: - model = models.Book + model = models.Edition exclude = [ 'created_date', 'updated_date', @@ -91,8 +91,8 @@ class BookForm(ModelForm): 'shelves', 'misc_identifiers', - 'subjects', - 'subject_places', + 'subjects',# TODO + 'subject_places',# TODO 'source_url', 'connector', diff --git a/fedireads/templates/edit_book.html b/fedireads/templates/edit_book.html index 83ba15c6..7e76fbee 100644 --- a/fedireads/templates/edit_book.html +++ b/fedireads/templates/edit_book.html @@ -29,12 +29,19 @@
{{ form.isbn }}
{{ form.fedireads_key }}
{{ form.openlibrary_key }}
{{ form.librarything_key }}
{{ form.goodreads_key }}
{{ form.physical_format }}
+{{ form.pages }}
+{{ form.title }}
diff --git a/fedireads/view_actions.py b/fedireads/view_actions.py index 62a25f03..f32501a8 100644 --- a/fedireads/view_actions.py +++ b/fedireads/view_actions.py @@ -95,11 +95,11 @@ def edit_book(request, book_id): return redirect('/book/%s' % request.user.localname) try: - book = models.Book.objects.get(id=book_id) - except models.Book.DoesNotExist: + book = models.Edition.objects.get(id=book_id) + except models.Edition.DoesNotExist: return HttpResponseNotFound() - form = forms.BookForm(request.POST, request.FILES, instance=book) + form = forms.EditionForm(request.POST, request.FILES, instance=book) if not form.is_valid(): return redirect(request.headers.get('Referer', '/')) form.save() diff --git a/fedireads/views.py b/fedireads/views.py index a62b8027..e7a50650 100644 --- a/fedireads/views.py +++ b/fedireads/views.py @@ -433,7 +433,7 @@ def edit_book_page(request, book_identifier): book = books_manager.get_or_create_book(book_identifier) data = { 'book': book, - 'form': forms.BookForm(instance=book) + 'form': forms.EditionForm(instance=book) } return TemplateResponse(request, 'edit_book.html', data)