Removing duplicates due to order by fields from a related model

I have 2 different models in the same app

I have 2 different models in the same app

class Book(models.Model):
    title = models.CharField(max_length=250, unique=True)
    slug = models.SlugField(max_length=50)
    description = models.TextField(max_length=500)

class Chapter(models.Model):
book = models.ForeignKey(Book,on_delete=models.CASCADE)
num = models.PositiveIntegerField(verbose_name="Chapter Number")
rdate = models.DateTimeField(verbose_name="Release Date", default=timezone.now)

What I want to do is get all books ordered by descending of release date rdate What I tried is:

Book.objects.all().order_by('-chapter__rdate').distinct()

Some duplicates were found in result, I only had 2 books added, so only 1 book was duplicated. The result was something like this: Book1, Book2, Book2

I have already seen the note from here, and im using SQLite. By using values(), I won't be able to call get_absolute_url() and some other methods that I want to call so using values() is out of question.

Next I tried to annotate the Chapter rdate into Book query like thisBook.objects.all().annotate(bdate=ExpressionWrapper(F('chapter__rdate'), output_field=DateTimeField())).order_by('-bdate').distinct()

Still ended in the same result. I'm totally lost, please need help. I probably won't change to PostgreSQL now, but I might use it when I deploy the app, so I want both SQLite version and PostgreSQL version solutions for this if at all possible. SQLite solution is absolutely necessary for me since it's easy to use in development.

Python Django Tutorial | Django Course

Python Django Tutorial | Django Course

🔥Intellipaat Django course: https://intellipaat.com/python-django-training/ 👉This Python Django tutorial will help you learn what is django web development &...

This Python Django tutorial will help you learn what is django web development & application, what is django and introduction to django framework, how to install django and start programming, how to create a django project and how to build django app. There is a short django project as well to master this python django framework.

Why should you watch this Django tutorial?

You can learn Django much faster than any other programming language and this Django tutorial helps you do just that. Our Django tutorial has been created with extensive inputs from the industry so that you can learn Django and apply it for real world scenarios.

Django

Well i used django ... i want to know after completing all the coding stuff, can i make all the codes online ?

Well i used django ... i want to know after completing all the coding stuff, can i make all the codes online ?

as Django give you a local host, i have a .com domain but can i integrate the codes to it so it works ?