Closed mattions closed 12 years ago
I've just noticed that the Thread.objects.inbox returns only the thread with two or more users.
I'm wondering if this is for design (and an easy way to exclude the sent thread and not answered, with the one with a conversation.)
consider this code:
In [66]: Thread.objects.inbox(2) Out[66]: [<Thread: Thread object>, <Thread: Thread object>]
and this result
In [65]: Thread.objects.filter(userthread__user=2) Out[65]: [<Thread: Thread object>, <Thread: Thread object>, <Thread: Thread object>, <Thread: Thread object>, <Thread: Thread object>, <Thread: Thread object>]
All the other threads have been created with user.pk==2, and there is no answer to them.
read the code, I saw the unread and deleted filter are applied, which cause the difference
I've just noticed that the Thread.objects.inbox returns only the thread with two or more users.
I'm wondering if this is for design (and an easy way to exclude the sent thread and not answered, with the one with a conversation.)
consider this code:
and this result
All the other threads have been created with user.pk==2, and there is no answer to them.