File: urls.py

package info (click to toggle)
django-filter 25.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,228 kB
  • sloc: python: 7,970; javascript: 7,213; makefile: 157; sh: 16
file content (19 lines) | stat: -rw-r--r-- 354 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from django.urls import path

from django_filters.views import FilterView, object_filter

from .models import Book


def _foo():
    return "bar"


urlpatterns = [
    path(
        "books-legacy/",
        object_filter,
        {"model": Book, "extra_context": {"foo": _foo, "bar": "foo"}},
    ),
    path("books/", FilterView.as_view(model=Book)),
]