Did I find the right examples for you? yes no

All Samples(5)  |  Call(5)  |  Derive(0)  |  Import(0)

src/d/j/django-lfs-HEAD/lfs/manage/discounts/views.py   django-lfs(Download)
    """
    try:
        discount = Discount.objects.all()[0]
    except IndexError:
        url = reverse("lfs_manage_no_discounts")
    return render_to_string(template_name, RequestContext(request, {
        "current_id": current_id,
        "discounts": Discount.objects.all(),
    }))
 

src/d/j/django-lfs-0.7.7/lfs/manage/discounts/views.py   django-lfs(Download)
    """
    try:
        discount = Discount.objects.all()[0]
    except IndexError:
        url = reverse("lfs_manage_no_discounts")
    return render_to_string(template_name, RequestContext(request, {
        "current_id": current_id,
        "discounts": Discount.objects.all(),
    }))
 

src/d/j/django-lfs-0.7.7/lfs/discounts/utils.py   django-lfs(Download)
def get_valid_discounts(request, product=None):
    """Returns all valid discounts as a list.
    """
    discounts = []
    for discount in Discount.objects.all():