Princeton-CDH / mep-django

Shakespeare and Company Project - Python/Django web application
https://shakespeareandco.princeton.edu
Apache License 2.0
5 stars 1 forks source link

As a content editor, I want to batch import new data on books' genre, so that I can update multiple records with annotations made externally #791

Closed quadrismegistus closed 1 month ago

quadrismegistus commented 8 months ago

Notes:

Update 2/1/24: We have this working now in the admin interface on QA using django-import-export. If you go to /admin/books/work you should see an import and export button. Export should export all Works, with all fields. Import should, for now, import only the fields relevant to the currently annotated data (genre category).

Testing instructions

jkotin commented 6 months ago

We have given a "genre" for each item/book in the lending library: drama, fiction, nonfiction, poetry, periodical, N/A. We should discuss/confirm that these are the best labels. We may also consider whether we should create a structure that would allow future work: e.g. dividing nonfiction into philosophy, history, etc. We don't have time to do that kind of dividing now.

jkotin commented 4 months ago

Small thing: there's a typo in "genre category" -- it's reads "Genre Cateogry."

jkotin commented 4 months ago

I received an error message when trying to do the larger import. Maybe I should do the import from campus? If so, I can try again on Tuesday.

Screenshot 2024-02-08 at 9 25 05 PM
jkotin commented 4 months ago

Two additional notes:

  1. As you mention, we will want some books to have multiple "genre" categories.
  2. Will we be able to edit the genre category on individual work pages in the database? This is important: in case we make a mistake and need to fix it. For example, we might mis-categorize a book as a novel when its true crime.
jkotin commented 4 months ago

I opened the test site this evening to finishing testing. The import went through despite the error message (see above) -- but the import added 23 "empty" works. See this screenshot.

Screenshot 2024-02-09 at 11 03 05 PM
jkotin commented 4 months ago

For this test:

Try re-importing the 10 book csv above but first editing it in excel to replace slug in the header with slugxx or another word; then make sure an error is shown

I did as instructed, but didn't see an error message.

jkotin commented 4 months ago

When I try to do this:

If more than 1,000 records updated, check that a warning message shows at top of page indicating that a server-side index will be necessary

I get this error message:

Screenshot 2024-03-02 at 7 33 13 PM
jkotin commented 2 months ago

Still receiving an error message.

Screenshot 2024-04-22 at 8 24 11 PM
jkotin commented 2 months ago

This is the CSV I used.

books-with-category(3).csv

rlskoeser commented 2 months ago

@jkotin I figured out what caused the error: your CSV had the heading 'category' but you and Ryan decided to set the database to allow multiple, so the import was expecting it to be called 'categories'. I've revised the input so it should work with either category or categories. Please confirm.

jkotin commented 2 months ago

I'm getting an error again, but I suspect that's because the VPN sometimes gets weird. I can try again from campus on Monday evening.

Screenshot 2024-05-05 at 12 50 21 PM
jkotin commented 1 month ago

I tried from campus and got the same error warning.

Screenshot 2024-05-06 at 6 25 40 PM
rlskoeser commented 1 month ago

@jkotin I see log messages indicates data is being imported and then it stops; no error, but I think it may be getting cut off by a timeout on the load balancer. I'll talk to PUL about increasing the timeout and let you know.

rlskoeser commented 1 month ago

@jkotin I've coordinated with PUL to increase the timeout on the load balancer, when you get the chance please test this again and report back on whether it works or if you're still getting the error.

jkotin commented 1 month ago

Yay! It worked.