I have two tables Rule and Zone, this is my Rule table which contain zone id as a foreign key :
I'm using this code to print the list of the values from the datatable SQLITE :
rules_namelist = []
rule = Rule.objects.all()
for rules in rule:
rules_entity =rules.entity
rules_value =rules.value
rules_namelist.append({rules_entity:rules_value})
print(rules_namelist)
And I'm getting this ouuput :
[{'LOWER': 'total'}, {'TEXT': '£'}, {'LIKE_NUM': True}, {'SHAPE': 'dd/dd/dddd'}, {'LOWER': 'total'}, {'TEXT': '£'}, {'LIKE_NUM': True}, {'SHAPE': 'dd/dd/dddd'}]
I want to get just the values of the same id and print it and then get the values of the next id, Please how can I do that. Any help is highly appreciated
