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 authors/creator information, so that I can update multiple records with annotations made externally #792

Closed quadrismegistus closed 5 months ago

quadrismegistus commented 11 months ago

This is the creator csv of information we want to import. These columns should all be able to map to fields in the django database. We'll investigate. https://flatgithub.com/Princeton-CDH/geotaste/blob/main/data/1.3-beta/creators.csv?filename=data%2F1.3-beta%2Fcreators.csv&sha=95b385b2c79462bff622d9c01ed7dc0baf3a9a27

Update 2/1/24: We have this working now in the admin interface on QA. If you go to /admin/people/person you should see an import and export button. Export should export all Persons, member or creator or both, with all fields. Import should, for now, import only the fields relevant to the currently annotated data (nationality and gender of authors).

Testing instructions

jkotin commented 9 months ago

We have a csv with gender and nationality information for creators, drawn from VIAF and then supplemented by hand. This information should fit nicely in the gender and nationality sections that are already in the database.

jkotin commented 7 months ago

Re:

Confirm csv export works and that fields are present

The instructions do not include the fields to verify. They all seem present. Here's a screenshot:

Screenshot 2024-02-09 at 11 14 07 PM
jkotin commented 7 months ago

Re:

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 didn't see a warning message

jkotin commented 7 months ago

Re:

Confirm that authors previously without nationality and gender now have them when seen from the admin interface

I don't think this worked—only about 800 creators have nationalities. I tried a second time—same result. See Elizabeth von Arnim—no nationality present after the import. I'm sorry if I've missed something!

jkotin commented 7 months ago

Re:

Try re-importing the 10 person 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

This worked—I received an error message!

jkotin commented 7 months ago

This all looks good @quadrismegistus and @rlskoeser except for:

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

Can I close anyway?

rlskoeser commented 7 months ago

@jkotin please wait to close until I can check to see why you didn't see the message.

jkotin commented 5 months ago

I still don't see a "warning message." But the import seemed to work. See screenshots.

Screenshot 2024-04-22 at 8 10 27 PM Screenshot 2024-04-22 at 8 12 10 PM
rlskoeser commented 5 months ago

@jkotin thanks for including the screenshots. The "warning message" is the one in yellow in your second screenshot (thanks for including those!); do you see how it says that only the first 1000 changes were indexed?

Please let me know if this is clear enough (maybe the testing instructions were unclear).

FWIW, I'm not sure how strictly necessary this limit is, and the 1000 is somewhat arbitrary. Ryan was concerned about the indexing taking too long and the import hanging - it seemed more important to show the results of your import.

jkotin commented 5 months ago

Great! I was expecting the warning message to say "warning"!