Closed macolo closed 4 years ago
Hi @mrts thanks! You are right the solution is not ready for integration in a module yet. Specifically its still unclear how to get the query type parameter ('_exact', 'gte', 'lte', etc) in the template. Its currently hard-coded.
Just mention this is for #7 to be linked properly.
When this will merged? I think it would be a great improvement.
@mrsarm Do you have time to review this (carefully, meticulously, deliberately :))?
@macolo checking the changes in the README file, why should we add CSS and JS dependencies to the ModelAdmin class?
If you are using the same Selecte2 component built-in with Dango 2, we shouldn't add any extra-dependency like if we have Django<2.0. Right?
Didn't work with Django 2.0.7.
I installed the dependency in my virtual env with Python 3.6:
pip install --upgrade -e git://github.com/what-digital/django-admin-list-filter-dropdown.git@c5c715ffa87e281f8a28863790970a9709d332ca#egg=django-admin-list-filter-dropdown
Then added to my ModelAdmin:
js = (
'admin/js/vendor/jquery/jquery.min.js',
'admin/js/vendor/select2/select2.full.min.js',
'admin/js/jquery.init.js',
'django_admin_listfilter_dropdown/autocomplete.js',
)
css = {
'screen': (
'admin/css/vendor/select2/select2.min.css',
'admin/css/autocomplete.css',
),
}
And the fields defined with:
search_fields = ('id', 'title', 'item__item_description',
'user', 'user__first_name', 'user__last_name')
list_filter = (
('user', RelatedSelect2DropdownFilter),
But I see this:
Also the dropdown in the screenshot doesn't have any option other than "All". I don't see any error logged in the Python console or the browser console neither.
Thanks a lot for testing! Let's wait for @macolo's comments
@mrts have you done all the steps in https://github.com/mrts/django-admin-list-filter-dropdown/pull/8/files#diff-04c6e90faac2675aa89e2176d2eec7d8 ?
@mrsarm , I think @macolo 's question was addressed to you - have you done all the steps in https://github.com/mrts/django-admin-list-filter-dropdown/pull/8/files#diff-04c6e90faac2675aa89e2176d2eec7d8 ?
Hey @macolo , what steps do you think are missed from the steps in mentioned here https://github.com/mrts/django-admin-list-filter-dropdown/pull/8#issuecomment-409276561 ?
@mrsarm looking at your feedback I am not sure whether you added the app before django admin in INSTALLED_APPS
@macolo oh yes, I didn't mention that because i already had the plugin configured in my project (the latest stable version), here are my installed apps:
INSTALLED_APPS = [
'mtasks.apps.MtasksConfig',
'advanced_filters',
'admin_view_permission',
'django_admin_listfilter_dropdown',
'adminfilters',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
]
I'll have a look at this with a new django test setup to see whether I can reproduce the troubles.
closed in favour of https://github.com/farhan0581/django-admin-autocomplete-filter
Great work! Many thanks for your contribution 🙂 ! I'm compelled to just press the green Merge button - but I would like to ponder over this a bit more, investigate if it's possible to simplify and test.