2024-01-19
Created Jan. 19, 2024, 3:42 p.m.
Modified Jan. 20, 2024, 2:04 p.m.
Goal
Busy with the Twitch Stream today, worked on developing how to select fighters.
Notes
Needed to Django Bulk Upload for names in the Fighters App.
from fighters.models import FighterName
import json
from itertools import islice
with open(r"C:\Users\Billy\Documents\HitHub\bulk_uploads\Fighters\fighter_names.json", "r") as f:
fighter_name_data = json.load(f)
# Build up the objects data
objs = []
for _, name_data in fighter_name_data.items():
objs.append(FighterName(
text = name_data["title"],
type = name_data["type"],
rarity = name_data["rarity"],
))
FighterName.objects.bulk_create(objs)
Results
- Created a new Django Model for Names (Prefix / Suffix / Base Name)
Next Time
- Django Bulk Upload the names into the names app