upenndigitalscholarship / deep

MIT License
3 stars 1 forks source link

Item Specific Alternative Keywords #232

Closed ZacharyLesser closed 1 month ago

ZacharyLesser commented 1 month ago

These need to all be copied from Title level "Work Alternative Keywords" This was already done and it seems that most are there but we have found a few that are not, so we need to check that the fields are always identical. Where they are not, copy "Work Alt Keywords" into "Item Specific Alt Keywords"

apjanco commented 1 month ago

In [8]: for item in Item.objects.all(): ...: if item.edition.title.title_alternative_keywords and (item.edition.title.title_alternative_keywords ! ...: = item.item_alternative_keywords): ...: print(item.deep_id, item.edition.title.title_alternative_keywords,item.item_alternative_keywords) ...: ...: 1086 Emperour Alfonso Emperour 5076.09 Cataline's None 5143.17 of None 571 Cataline's None 5011.01 Queens City of Queen Bristow Queens Queen Bristow 5124.16 Loves Kings King Love Abbey Loves Kings King Love 5008 Hundreth Sundrie Flowres None 5010 Hundreth Sundrie Flowres None 5080 Workes None 859 Vow-Breaker None 5103 Workes None 947 Walkers Night-Walkers None 5077 betwixt None 570 Cataline's None 572 Cataline's None 5013.01 Queens City of Queen Bristow Queens Queen Bristow 5007 Hundreth Sundrie Flowres None 656 Sidero-Thriambos None 1087 Emperour Alfonso Emperour 5058 One and Two None 5074.16 Cataline's None 92 Freewill None 5009 Hundreth Sundrie Flowres None 5009.5 Hundreth Sundrie Flowres None

apjanco commented 1 month ago

removed n [9]: for item in Item.objects.all(): ...: if item.edition.title.title_alternative_keywords and (item.edition.title.title_alternative_keywords ! ...: = item.item_alternative_keywords): ...: item.item_alternative_keywords = item.edition.title.title_alternative_keywords ...: item.save() ...: #print(item.deep_id, item.edition.title.title_alternative_keywords,item.item_alternative_keywords ...: ) ...: