From 9235105dcb2e1b473981327b80134e05291d0278 Mon Sep 17 00:00:00 2001 From: d0c Date: Wed, 11 Jan 2023 17:44:59 +0100 Subject: [PATCH] error on bluetooth queryset --- suitablephones/management/commands/fetchphones.py | 6 ++++-- suitablephones/models.py | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/suitablephones/management/commands/fetchphones.py b/suitablephones/management/commands/fetchphones.py index e7db805..4785ae6 100644 --- a/suitablephones/management/commands/fetchphones.py +++ b/suitablephones/management/commands/fetchphones.py @@ -32,11 +32,13 @@ 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() -# elif key == "cameras": -# cam = [] + elif key == "cameras": + print('camera') +# cam = [] # for c in Camera.objects.filter(*value.items()) # cam.append(c) # if not cam.exists(): diff --git a/suitablephones/models.py b/suitablephones/models.py index fb85dea..f6960e4 100644 --- a/suitablephones/models.py +++ b/suitablephones/models.py @@ -8,7 +8,7 @@ class Bluetooth(models.Model): profiles = models.CharField(max_length=100) def __str__(self): - return f"Bluetooth: {self.spec - self.profiles}" + return f"Bluetooth: {self.spec} - {self.profiles}" class Camera(models.Model):