how do i loop through fields of an object?
django, model, python
Solution
First get them, then use a for loop or list comprehension.
Problem
I have a model like this, how can I loop through it and not have to type out company.id, company.name, etc? ``` class Company(models.Model): name = models.CharField(max_length=1000) website = models.CharField(max_length=1000) email = models.CharField(max_length=200) phone_number = models.CharField(max_length=100) city = models.CharField(max_length=1000) zip = models.IntegerField() state = models.CharField(max_length=1000) address = models.CharField(max_length=1000) address2 = models.CharField(max_length=1000) ```