Hi.
I have following structure with example data:
id season_id title
1 1 Intro
2 1 Second part
3 1 Third part
4 4 Other intro
5 4 Other second part
(don't ask why), where season_id is always point to id of first episode of season...
What i want, to get following:
1 1 Intro
4 4 Other intro
which are first episoded for season, technically speaking - all entries with lowest *season_eid*
for and i am using following query to get ids of them:
Movie.objects.filter(category_type = 2).values('season_eid').annotate(models.Min('season_eid'))
and having id i can get all data for objects using django orm __in construction.
Can I make grouping / annotate and take all fields/values using only one query? values + annotate gives me only list of dictionaries, but instead of this i would like to get proper objects (lowest value/min of season_eid) with rest of fields.