Есть таблица бд на 24 поля. Сделана выборка:
def detail(request, the_model):
the_model = urllib.unquote(the_model)
gadget = PhoneModel.objects.get(model_name = the_model)
features = Feature.objects.get(model_name = gadget.id)
В итоге получаю один объект с 24 полями. Возможно ли итерировать поля? Или не обойтись без непосредственного вызова всех полей в шаблоне?
{{ features.network }}
e.t.c
Таблица
class Feature(models.Model):
model_name = models.ForeignKey(PhoneModel)
control = models.CharField(max_length = 150, blank = True)
network = models.CharField(max_length = 150, blank = True)
navigation = models.CharField(max_length = 150, blank = True)
sim = models.IntegerField(max_length = 1, blank = True)
screen = models.CharField(max_length = 150, blank = True)
camera = models.CharField(max_length = 150, blank = True)
audio = models.CharField(max_length = 150, blank = True)
video = models.CharField(max_length = 150, blank = True)
images = models.CharField(max_length = 150, blank = True)
e_book = models.CharField(max_length = 150, blank = True)
memory = models.CharField(max_length = 150, blank = True)
messsages = models.CharField(max_length = 150, blank = True)
data_transfer = models.CharField(max_length = 150, blank = True)
applications = models.CharField(max_length = 150, blank = True)
phone_book = models.CharField(max_length = 150, blank = True)
organizer = models.CharField(max_length = 150, blank = True)
ringtone = models.CharField(max_length = 150, blank = True)
operation = models.CharField(max_length = 150, blank = True)
the_set = models.CharField(max_length = 300, blank = True)
color = models.CharField(max_length = 150, blank = True)
size = models.CharField(max_length = 40, blank = True)
language = models.CharField(max_length = 350, blank = True)
extra = models.CharField(max_length = 350, blank = True)