معرفی شرکت ها


django-listview-filters-0.0.1b1.dev1


Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر

توضیحات

Add context to list views for sidebar links and modifying querysets with those links.
ویژگی مقدار
سیستم عامل -
نام فایل django-listview-filters-0.0.1b1.dev1
نام django-listview-filters
نسخه کتابخانه 0.0.1b1.dev1
نگهدارنده []
ایمیل نگهدارنده []
نویسنده -
ایمیل نویسنده Karl Wooster <karl.wooster@wsu.edu>
آدرس صفحه اصلی -
آدرس اینترنتی https://pypi.org/project/django-listview-filters/
مجوز MIT License Copyright (c) 2022 Washington State University - Tri-Cities Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# Django ListView Filters Add context to list views for sidebar links and modifying querysets with those links. ## Purpose Attempting to duplicate the functionality of the [`ModelAdmin` List Filter](https://docs.djangoproject.com/en/stable/ref/contrib/admin/filters/) capabilities. This is largely a copy-paste of the source code for that modified to work outside of the admin interface. For example, references to `model_admin` have been removed. ## Additional Functionality A few customizations are added. ### Add 'Clear Filter' Context Allow for replacing the 'All' link with a button that clears the parameter from the query. ### Only List Lookups With Matches Allow for filtering of list for sidebar to only those with matches. That way empty links aren't taking up valuable space. ### Add Count to Context Add the count of number of objects to each link that can be shown in the template. ## Configuration ### Model ```python from django.db import models class Author(models.Model): name = models.CharField("Author's Name", max_length=100) birthday = models.DateField("Author's Birthday", blank=True) class Book(models.Model): title = models.CharField("Book Title", max_length=150) author = models.ForeignKey(Author, on_delete=models.PROTECT) ``` ### Class-based View ```python from django.view.generic import ListView from django-listview-filters import RelatedFieldListViewFilter class AuthorListView(ListView): context_object_name = "author" queryset = Author.objects.order_by("name") class BookListView(ListView): context_object_name = "book" queryset = Author.objects.order_by("title") list_filter = [ ('author', RelatedFieldListViewFilter) ] ``` ### Template ```python {% for filter_name, filter_objects, clear_fragment in filter_list %} <div> {{ filter_name|title }} <a href="{{ clear_fragment }}">clear filter</a> </div> <ul> {% with filter_objects|dictsort:"display" as display_list %} {% for item in display_list %} <div> <a href="{{ item.query_string }}"> {{ item.display }} </a> </div> {% endfor %} {% endwith %} </ul> </div> ```


نیازمندی

مقدار نام
- django
- furl


زبان مورد نیاز

مقدار نام
>=3.10 Python


نحوه نصب


نصب پکیج whl django-listview-filters-0.0.1b1.dev1:

    pip install django-listview-filters-0.0.1b1.dev1.whl


نصب پکیج tar.gz django-listview-filters-0.0.1b1.dev1:

    pip install django-listview-filters-0.0.1b1.dev1.tar.gz