Add subcommand to delete old records

This commit is contained in:
littlewolf 2019-11-21 19:37:37 +03:00
parent a7513e6ca0
commit c817dd4979

View File

@ -498,13 +498,13 @@ def fix_location_models():
fix_tag_category()
fix_chosen_tag()
def remove_old_records():
clean_old_records(City, {"mysql_id__isnull": True})
clean_old_records(Region, {"mysql_ids__isnull": True})
clean_old_records(City, {"mysql_ids__isnull": True})
def transfer_city_gallery():
created_counter = 0
cities_not_exists = {}
@ -563,6 +563,7 @@ data_types = {
"fix_location": [
fix_location_models
],
"remove_old_locations":[remove_old_records],
"fill_city_gallery": [transfer_city_gallery]