-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b2eb42a
commit 6bb5ca2
Showing
2 changed files
with
26 additions
and
51 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import os | ||
import django | ||
|
||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "spacelaunchnow.settings") | ||
django.setup() | ||
|
||
from api.models import * | ||
from configurations.models import * | ||
|
||
if __name__ == '__main__': | ||
deceased, created = AstronautStatus.objects.get_or_create(name='Deceased') | ||
retired = AstronautStatus.objects.get(name='Retired') | ||
retired_with_death_date = Astronaut.objects.filter(status=retired).filter(date_of_death__isnull=False) | ||
for astronaut in retired_with_death_date: | ||
print("--------------------------------") | ||
print(astronaut) | ||
print(astronaut.status) | ||
print(astronaut.date_of_death) | ||
print("Migrating...") | ||
astronaut.status = deceased | ||
astronaut.save() | ||
print(astronaut) | ||
print(astronaut.status) | ||
print(astronaut.date_of_death) | ||
print("--------------------------------") | ||
print("/n") |
This file was deleted.
Oops, something went wrong.