How to get the id of an entry based on the name in Django?
i have created the following model in Django to store my groups in a database:
name = models.CharField(max_length=1000)
now i would like to get the id of a group by its name in my views.py. How do I do that?
Group.objects.get() method i can filter by name, but there i get the whole row without the id
You can query like this: