You should be able to say something like
project = Project.objects.get(project_id = some_id)
if project.item_set.all():
   # there are items
else:
   # there are no items

On Aug 23, 5:41 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> Sorry, but I could not get a decent short subject.
>
> I have two models. Model A defines a "project", model B defines
> related items. I need to have a method in Model A that queries the
> related Model B items and returns T/F depending on what it finds. For
> example, if this were a project with tasks, then if any related tasks
> are due the project's hasDueTasks() method would return True.
>
> I could have sworn I've done this before but can't seem to find where
> I did. What would be the best way of going about this that does not
> involve a third process doing db updates?


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to