<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def hooks(self, project):
 """ Look up the urls we need to post to"""


        return self.get_queryset().filter(
            Q(project=None) |
            Q(project=project)
        ).distinct('url')