``query_dict``: a dictionary to look for a key dedicated to ordering purpose
>>> get_order_by({})
-
+
>>> get_order_by({ORDER_BY_KEY: 'f'})
'sender__username'
>>> get_order_by({ORDER_BY_KEY: 'D'})
"""
return self.inbox(user, related=False, option=OPTION_MESSAGES).filter(read_at__isnull=True).count()
-
+
def sent(self, user, **kwargs):
"""
Return all messages sent by a user but not marked as archived or deleted.
Typical usage: sender|or_me:user
"""
- if not isinstance(value, (unicode, str)):
- value = unicode(value)
- if not isinstance(arg, (unicode, str)):
- arg = unicode(arg)
+ value = unicode(value.first_name) + ' ' + unicode(value.last_name)
+ arg = unicode(arg.first_name) + ' ' + unicode(arg.last_name)
+
return _('<me>') if value == arg else value
@register.filter(**({'expects_localtime': True, 'is_safe': False} if VERSION >= (1, 4) else {}))