From 6a2cc0c7754f16c0882cede80fd2fe023705a958 Mon Sep 17 00:00:00 2001 From: d0c Date: Thu, 12 Jan 2023 01:38:20 +0100 Subject: [PATCH] bt complete --- suitablephones/management/commands/fetchphones.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/suitablephones/management/commands/fetchphones.py b/suitablephones/management/commands/fetchphones.py index 4785ae6..4ff6e46 100644 --- a/suitablephones/management/commands/fetchphones.py +++ b/suitablephones/management/commands/fetchphones.py @@ -25,6 +25,7 @@ class Command(BaseCommand): data = yaml.safe_load(stream) dev = Device() for key, value in data.items(): + print(key) if key == "bluetooth": bt = Bluetooth.objects.filter(**value) if not bt.exists(): @@ -32,10 +33,8 @@ class Command(BaseCommand): for subkey, subvalue in value.items(): setattr(bt, subkey, subvalue) bt.save() - dev.bluetooth = bt - #for subkey, subvalue in value.items(): - # setattr(bt, subkey, subvalue) - # bt.save() + else: + dev.bluetooth = bt.get() elif key == "cameras": print('camera') # cam = []