Hi,
On Jan 16, 1:04 pm, rmschne <[email protected]> wrote:
> qs=DinnerHost.objects.filter(complete=True)
> and tried
> gs=DinnerHost.objects.filter(complete()=True
Try something along the lines of,
class DinnerHostManager(models.Manager):
def complete(self):
return self.filter(
sponsor=True,
isadreceived=True,
isfullybooked=True)
class DinnerHost(models.Model):
member = models.ForeignKey(Member, null=True,
db_column='memberid', related_name="hosts", blank=True)
meeting = models.ForeignKey(Meeting, null=True,
db_column="meetingid", related_name="hosts", blank=True)
host = models.CharField(max_length=300, db_column='Host',
blank=True)
sponsor = models.BooleanField(db_column='Sponsor', blank=True)
objects = DinnerHostManager()
# Do the selection
gs=DinnerHost.objects.complete()
Although the filter above needs a little work ;-)
aid
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.