This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Archive the given projects. | |
for name in project_names: | |
project = sg.find_one('Project', [['name', 'is', name]]) | |
sg.update('Project', project['id'], {'archived': True}) | |
# Make sure all archived projects are named "delete_me_" + timestamp | |
for project in sg.find('Project', filters=[['archived', 'is', True]]): | |
if project['name'].startswith('delete_me_'): | |
continue | |
new_name = 'delete_me_{}_{}'.format(dt.datetime.now(), project['name']) |