Пример #1
0
def get_activate_task_message(chat_id, limit=5):
    user = Profile.get_user_by_chat_id(chat_id)
    out = ''
    for t in Task.objects.filter(user=user).order_by('-is_active',
                                                     'id')[0:limit]:
        if t.is_active:
            out += '\n <strong>#%s %s</strong>' % (t.id, t)
        else:
            out += '\n #%s %s' % (t.id, t)
    return out
Пример #2
0
def get_list_task_message(chat_id, limit=5):
    user = Profile.get_user_by_chat_id(chat_id)
    items = Task.objects.filter(user=user).order_by('-is_active',
                                                    'id')[0:limit]
    if len(items) == 0:
        return 'У вас нет заявок.'
    out = ''
    for t in items:
        if t.is_active:
            out += '\n <strong>#%s %s: %s</strong>' % (t.id, t.title,
                                                       t.get_status)
        else:
            out += '\n #%s %s: %s' % (t.id, t.title, t.get_status)
    return out