Saturday, August 14, 2010

Re: django queryset get only one result for one column pair

My models are defined like this:

class Problem(models.Model):
title = models.CharField('Title', max_length = 100)
question = models.TextField('Question')

class Submission(models.Model):
user = models.ForeignKey(User)
problem = models.ForeignKey(Problem)
solution = models.CharKey()
time = models.DateTimeField('Time', auto_now_add=True)

I want to run a sql command on submission field and get the list of
submissions ordered by submission time and will include only one
result if there are more than one submissions by a same user in one
problem.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate