Murilo Vicentini
unread,Mar 15, 2012, 8:07:08 PM3/15/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to django...@googlegroups.com
Hey guys, sorry if this is a newbie question, but I'm new at django and I'm having a real hard time trying to figure out how to solve this. So I have this model.
class Run(models.Model):
speccpus = models.ForeignKey('Speccpu')
hosts = models.ForeignKey('Host')
Task = models.IntegerField()
Path = models.CharField(max_length = 300)
Date_Time = models.DateTimeField()
class Host(models.Model):
Name = models.CharField(max_length = 100)
ip_addr = models.IPAddressField()
admin_ip_addr = models.IPAddressField()
Location = models.CharField(max_length = 100)
class Speccpu(models.Model):
Version = models.CharField(max_length = 50)
Base_score = models.IntegerField()
Peak_score = models.IntegerField()
So what i need to do is search a for an input in any of this fields, so they can return more than one row of a table, since i need to display on the screen a table containing the Run - Task, Path, Date_Time fields, also the Host Name field, and the Speccpu Base and peak score. I was thinking about doing something like an inner join of this three models, and then filtering. But i can't manage to do it. Does anyone have any ideia of how i can do it using the queryset API?