MCPcopy Create free account
hub / github.com/alpha2phi/python-apps / resolve_links

Method resolve_links

hackernews/backend-python/links/schema.py:26–45  ·  view source on GitHub ↗
(self,
                      info,
                      search=None,
                      first=None,
                      skip=None,
                      **kwargs)

Source from the content-addressed store, hash-verified

24
25 # Use them to slice the Django queryset
26 def resolve_links(self,
27 info,
28 search=None,
29 first=None,
30 skip=None,
31 **kwargs):
32 qs = Link.objects.all()
33
34 if search:
35 filter = (Q(url__icontains=search)
36 | Q(description__icontains=search))
37 qs = qs.filter(filter)
38
39 if skip:
40 qs = qs[skip:]
41
42 if first:
43 qs = qs[:first]
44
45 return qs
46
47 def resolve_votes(self, info, **kwargs):
48 return Vote.objects.all()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected