diff options
Diffstat (limited to 'apps/accounts/models.py')
-rw-r--r-- | apps/accounts/models.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/apps/accounts/models.py b/apps/accounts/models.py index d000e3e..1b62ffd 100644 --- a/apps/accounts/models.py +++ b/apps/accounts/models.py @@ -26,4 +26,4 @@ class UserProfile(models.Model): @cached_property def get_notebook_list(self): - return Notebook.objects.filter(owner=self.user).select_related()[:8] + return Notebook.objects.filter(owner=self.user).select_related().annotate(note_count=models.Count('note'))[:8] |