django views getid

Posted by Hulk on Stack Overflow See other posts from Stack Overflow or by Hulk
Published on 2010-03-29T11:27:16Z Indexed on 2010/03/29 11:33 UTC
Read the original article Hit count: 668

     class host(models.Model):
       emp = models.ForeignKey(getname)

def __unicode__(self):
  return self.topic

In views there is the code as,

    real =[]
    for emp in my_emp:
      real.append(host.objects.filter(emp=emp.id))

This above results only the values of emp,My question is that how to get the ids along with emp values.

Thanks..

© Stack Overflow or respective owner

Related posts about django

Related posts about django-views