I have a models A and B, that are like this:
class A(models.Model):
title = models.CharField(max_length=20)
(...)
class B(models.Model):
date = models.DateTimeField(auto_now_add=True)
(...)
a = models.ForeignKey(A)
Now I have some A and B objects, and I'd like to get a query that selects all A objects that have less then 2 B pointing at them.
A is something like a pool thing, and users (the B) join pool. if there's only 1 or 0 joined, the pool shouldn't be displayed at all.
Is it possible with such model design? Or should I modify that a bit?