mirror of
https://github.com/seanmorley15/AdventureLog.git
synced 2025-07-22 14:29:36 +02:00
starting trips
This commit is contained in:
parent
2d596fb550
commit
be9c3c6747
7 changed files with 151 additions and 3 deletions
|
@ -47,7 +47,7 @@ class TripViewSet(viewsets.ModelViewSet):
|
|||
def get_queryset(self):
|
||||
return Trip.objects.filter(
|
||||
Q(is_public=True) | Q(user_id=self.request.user.id)
|
||||
).select_related(
|
||||
).prefetch_related(
|
||||
Prefetch('adventure_set', queryset=Adventure.objects.filter(
|
||||
Q(is_public=True) | Q(user_id=self.request.user.id)
|
||||
))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue