mirror of
https://github.com/Hopiu/django-select2.git
synced 2026-03-23 08:40:24 +00:00
Fixed #231 -- Avoid fetching entire queryset from db
Patched ciritcal memory leak in ModelSelect2 widgets. Boolean evaluation of queryset makes django fetch all elements. Thanks to @magicjohnson for discovering this issue
This commit is contained in:
parent
18647161a1
commit
bb90be77b7
3 changed files with 5 additions and 2 deletions
|
|
@ -1,6 +1,9 @@
|
|||
Changelog Summary
|
||||
=================
|
||||
|
||||
### v5.4.1
|
||||
* Fixed memory leak in `ModelSelect2Mixin` and subclasses
|
||||
|
||||
### v5.4.0
|
||||
* Added `Select2TagWidget` a light widget with tagging support
|
||||
|
||||
|
|
|
|||
|
|
@ -9,4 +9,4 @@ The app includes Select2 driven Django Widgets and Form Fields.
|
|||
|
||||
"""
|
||||
|
||||
__version__ = "5.4.0"
|
||||
__version__ = "5.4.1"
|
||||
|
|
|
|||
|
|
@ -351,7 +351,7 @@ class ModelSelect2Mixin(object):
|
|||
:return: Filtered queryset
|
||||
:rtype: :class:`.django.db.models.QuerySet`
|
||||
"""
|
||||
if not queryset:
|
||||
if queryset is None:
|
||||
queryset = self.get_queryset()
|
||||
search_fields = self.get_search_fields()
|
||||
select = Q()
|
||||
|
|
|
|||
Loading…
Reference in a new issue