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 = []