# -*- coding: utf-8 -*-
from django import template
from orders.models import PaymentMethod

register = template.Library()


@register.simple_tag
def get_payment_methods():
    """
    Получить список активных способов оплаты.
    Использование: {% get_payment_methods as payment_methods %}
    """
    return PaymentMethod.objects.filter(is_active=True).order_by('order', 'name')
