Skip to content

Commit

Permalink
add control if deprecated NK ČR aut field
Browse files Browse the repository at this point in the history
  • Loading branch information
Jiri Sedlacek committed Jan 26, 2024
1 parent 905473b commit 5c35159
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tools.py
Expand Up @@ -47,6 +47,13 @@ def print_info(debug):
def add_new_field_to_item(debug: bool, repo: pywikibot_extension.MyDataSite, item_new_field: pywikibot.ItemPage,
property_new_field: str, value: object,
nkcr_aut_new_field: str):

claims_by_property = item_new_field.claims.get('P691', [])
for claim in claims_by_property:
if claim.getRank() == 'deprecated' and nkcr_aut_new_field == claim.getTarget():
#deprecated so not add
return None

sources = []

source_nkcr = pywikibot.Claim(repo, 'P248')
Expand Down

0 comments on commit 5c35159

Please sign in to comment.