tortoise / tortoise-orm

Familiar asyncio ORM for python, built with relations in mind
https://tortoise.github.io
Apache License 2.0
4.58k stars 378 forks source link

almost 15hr trying do nothing #1508

Closed neonarc4 closed 11 months ago

neonarc4 commented 11 months ago

what is the reason u have prefetch when it not prefetch anything

neonarc4 commented 11 months ago

selected_events = await Event.filter(
    participants=participants[0].id
).prefetch_related('participants', 'tournament')

# Tortoise supports variable depth of prefetching related entities
# This will fetch all events for Team and in those events tournaments will be prefetched
await Team.all().prefetch_related('events__tournament')

both of them dont work

neonarc4 commented 11 months ago

why their is no relationship model fetching logic in ur fastapi or any example how can we fetch relationship model