fetch arch field
This commit is contained in:
parent
6c3ce23e0e
commit
e81d005f58
1 changed files with 6 additions and 1 deletions
|
@ -25,10 +25,15 @@ class Command(BaseCommand):
|
||||||
data = yaml.safe_load(stream)
|
data = yaml.safe_load(stream)
|
||||||
dev = Device()
|
dev = Device()
|
||||||
for key, value in data.items():
|
for key, value in data.items():
|
||||||
|
if key == "architecture":
|
||||||
|
if type(value) == dict():
|
||||||
|
setattr(dev, key, value)
|
||||||
|
else: #type(value) == str():
|
||||||
|
setattr(dev, key, dict({ 'cpu' : value }))
|
||||||
#match caso:
|
#match caso:
|
||||||
# case dict():
|
# case dict():
|
||||||
# print('dict')
|
# print('dict')
|
||||||
if key == "bluetooth":
|
elif key == "bluetooth":
|
||||||
# get() returned more than one Bluetooth -- it returned 2!
|
# get() returned more than one Bluetooth -- it returned 2!
|
||||||
bt = Bluetooth.objects.filter(**value)
|
bt = Bluetooth.objects.filter(**value)
|
||||||
# __exact? https://docs.djangoproject.com/en/4.1/ref/models/querysets/#exact
|
# __exact? https://docs.djangoproject.com/en/4.1/ref/models/querysets/#exact
|
||||||
|
|
Loading…
Reference in a new issue