Comments (11)
Hi @dgleba thank you for your interest. Can you share your ModelAdmin
definition? Take not that the field definition is not implicit; you have to explicitly list each field you want to be able to filter by in the advanced_filter_fields
property, as demonstrated in the README.
from django-advanced-filters.
Sorry, I forgot to put that in the issue. I was editing that into my comment as you answered.
It is there now.
Thanks for the quick response.
from django-advanced-filters.
So your fields list is empty? Can you check your browser javascript console for any errors? Also, you don't need grappelli anymore, and both should be supported, but just for a check try removing grappelli.
from django-advanced-filters.
The fields list in the advanced filter form is empty.
Screen shots attached of javascript console with and without grappelli. It's empty either way.
full code for my test app is here: https://github.com/dgleba/edge225b
Without Grappelli...
With Grappelli:
from django-advanced-filters.
I installed django-advanced-filters
from github.
It still has the problem.
Title: I tried to install from github..
-----------------------2016-03-17[Mar-Thu]16-18PM
set wpip=c:\p2\Python27\Scripts\pip
%wpip% install https://github.com/modlinltd/django-advanced-filters/tarball/master
_____________
C:\n\web\edge225b\my_proj\src>set wpip=c:\p2\Python27\Scripts\pip
C:\n\web\edge225b\my_proj\src>
C:\n\web\edge225b\my_proj\src>%wpip% install https://github.com/modlinltd/django-advanced-filters/tarball/master
Downloading/unpacking https://github.com/modlinltd/django-advanced-filters/tarball/master
Running setup.py (path:c:\users\dgleba\appdata\local\temp\pip-ieqn9p-build\setup.py) egg_info for package from https://g
ithub.com/modlinltd/django-advanced-filters/tarball/master
PyPandoc not installed. Cannot convert README.md to rst
Requirement already satisfied (use --upgrade to upgrade): django-advanced-filters==1.0.1 from https://github.com/modlinl
td/django-advanced-filters/tarball/master in c:\p2\python27\lib\site-packages
Requirement already satisfied (use --upgrade to upgrade): django-easy-select2==1.2.5 in c:\p2\python27\lib\site-packages (
from django-advanced-filters==1.0.1)
Downloading/unpacking django-braces==1.4.0 (from django-advanced-filters==1.0.1)
Downloading django_braces-1.4.0-py2.py3-none-any.whl
Requirement already satisfied (use --upgrade to upgrade): simplejson==3.6.5 in c:\p2\python27\lib\site-packages (from djan
go-advanced-filters==1.0.1)
Requirement already satisfied (use --upgrade to upgrade): six in c:\p2\python27\lib\site-packages (from django-braces==1.4
.0->django-advanced-filters==1.0.1)
Installing collected packages: django-braces
Found existing installation: django-braces 1.8.1
Uninstalling django-braces:
Successfully uninstalled django-braces
Successfully installed django-braces
Cleaning up...
C:\n\web\edge225b\my_proj\src>
from django-advanced-filters.
Firstly, the javascript errors are odd, we don't use grappelli
(i.e the grp
object) in no javascript files in latest released version 1.0.1 (master), did you upgrade from a previous version?
Second, it is unfortunate that the form looks bad with django-edge
, but I cannot expect all themes to display the form nicely, and this may require some work. If you find a nice set of CSS rules that work, I'd appreciate a pull request.
Finally, GitHub master
branch should equal the latest release on PyPI, so I still cannot see why your field list would be empty. Tell me, are the listed fields ('owner', 'originator', 'project_number'
) actual fields on your Model
, or are they inherited, methods or other?
In any case, thank you for the detailed test case, and my apologies for the slow replies, I'll have a closer look at this in the weekend, before I release the 1.0.2 version.
from django-advanced-filters.
I did not upgrade from a previous version. I just installed it initially yesterday.
The fields ('owner', 'originator', 'project_number') are directly part of the model.
The model can be seen here.. https://github.com/dgleba/edge225b/blob/master/my_proj/src/cilist1/models.py
I will try this in a clean ubuntu vm with virtualenv and see what results I get there.
Your replies are not slow. I appreciate it. Thank you for looking at this.
from django-advanced-filters.
The issue seems to be with the indentation in your admin.py
module. The tuples list_display
, list_display_links
, advanced_filter_fields
and list_per_page
must all be properties of Cilisting1Admin
but are currently not - they are under-indented!
The solution is to add 4 spaces to all of the above to make them properties of the ModelAdmin
. Here's a screenshot of what happens after you fix that (see PR dgleba/edge225b#1 to your project for the code):
from django-advanced-filters.
I am very sorry I put you through this. I am embarrassed. That was not your issue at all.
Thank you for looking at this. It was stupid on my part.
All is, of course, working well after indenting properly.
Again I am sorry for wasting your time.
from django-advanced-filters.
Don't worry mate :) it's no trouble at all, good to hear your issue is resolved!
from django-advanced-filters.
Thanks.
from django-advanced-filters.
Related Issues (20)
- limit_choices_to in models are ignored HOT 1
- Feature request: Allow AND operator to work with M2M relationship HOT 5
- Reduce maintenance burden: drop support for old python & django HOT 1
- Error when using django compressor HOT 1
- js pages auto changes contains operator to equal
- Create locale django.mo files in CI
- Not possible to add another filter in the popup HOT 1
- Support for most recent select2 version
- builtins.AttributeError: 'AdvancedFilterQueryForm' object has no attribute 'cleaned_data' HOT 3
- 'AdvancedFilterQueryForm' object has no attribute 'cleaned_data'
- Saving an advanced filter with an "Or" in it sometimes reorders the "Or" to the last element
- Getting 'This Field is required" error while submitting form for the first time HOT 4
- Modal does not respect dark mode HOT 4
- already existing filter return low result number
- contains does not allow for custom text HOT 1
- Make SimpleJSON optional HOT 1
- But in the documntation and solution
- Only one filter shows field_choices HOT 2
- Avoid redirect when selecting a filter
- Django Compress causes errors HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-advanced-filters.