Comments (10)
I believe our mixin, being a partial/mixin (or sub-class) implementation of a ModelAdmin
, should be placed before the admin.ModelAdmin
in the class declaration. This SO answer explains it nicely. Try using this line and tell me how it goes:
class CurriculoAdmin(AdminAdvancedFiltersMixin, admin.ModelAdmin):
...
EDIT: In fact, taking a look at the code, this whole situation can be avoided by simply having our mixin inheriting from object
instead of ModelAdmin
over at admin.py
module.
from django-advanced-filters.
New error:
TypeError at /admin/curriculos/curriculo/
init() takes at least 2 arguments (1 given)
in /(...)/advanced_filters/admin.py in changelist_view
81. response = self.adv_filters_handle(request, kwargs)
:-/
from django-advanced-filters.
First of all, thanks for checking @mpena2099! It's rare to see visitors around here :)
As you must have noticed, the code hadn't been touched for quite a while.
But it's not to say the package wasn't being used. On the contrary, the application has evolved quite a bit from the initial state it was in when I initially published it to github (while still using the same core functionality).
In fact, the interest you've shown has motivated me to merge the changes from our branch into github as well as add some documentation, to the best of my ability.
I suggest you follow this thread as I will reference it when I finally push the update, hopefully that won't be too long from now.
from django-advanced-filters.
Thanks @asfaltboy! :D
from django-advanced-filters.
Advanced Filter button created but... don't do nothing.
First of all, it is necessary to add 'easy_select2' to INSTALLED_APPS. Now I see the errors below on error console from Safari:
[Warning] Invalid CSS property declaration at: * (select2.min.css, line 1)
[Error] TypeError: 'undefined' is not a function (evaluating 'e(window)')
(função anônima) (jquery.magnific-popup.js, line 4)
[Error] ReferenceError: Can't find variable: grp
global code (advanced-filters.js, line 154)
[Error] TypeError: 'undefined' is not an object (evaluating '$.magnificPopup.instance')
(função anônima) (curriculo, line 327)
[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (http://127.0.0.1:8000/static/easy_select2/vendor/jquery/jquery.js, line 0)
from django-advanced-filters.
Is your STATIC_ROOT configured properly?
from django-advanced-filters.
Yes @marklr, and I ran the command "collectstatic"...
from django-advanced-filters.
Hi @mpena2099, first of all you are right, easy_selecty2
should be added to support easy_select2 field usage. Will have to add this to the docs.
Second, our use case platform uses django-grappelli, hence the templates provided occasionally reference grp elements, as explained in the readme.
This might need some clarification in the docs, but basically anything (templates and static js/css files) can be overridden for different styling and front-end functionality, if desired. Take a peek in the js/html files, and let me know if you still have trouble implementing your own (non grappelli) template/frontend.
I believe our current frontend implementation requires jquery, and easy_select2
providе their own (in their "static/vendor" directory, as explained here.
If you are debugging locally there is no need to run collectstatic, rather make sure you have DEBUG turned on and the staticfiles app is enabled.
from django-advanced-filters.
@mpena2099; I decided that we might as well use the jQuery bundled with easy_select2 if we're gonna require them.
So this commit should now fix the issues you had when using the changelist on a non-grappelli.
Please note that the change form (for editing existing filters), still overrides grappelli's template, and will require another commit to fix. I've listed this in the short TODO list in the readme. So anyone can feel free to chime in and submit pull request on these things whenever they have some time.
from django-advanced-filters.
Hi!
OK, now it works... with Grappelli! (I was already thinking of using it in my project)
But... without Grappelli still some errors (ALL, I think, related to Grappelli):
[Error] ReferenceError: Can't find variable: grp
global code (actions.js, line 136)
[Error] TypeError: 'undefined' is not a function (evaluating '$(document)')
(função anônima) (curriculo, line 29)
[Error] TypeError: 'undefined' is not an object (evaluating '$.fn')
(função anônima) (orig_inlines.js, line 18)
[Error] TypeError: 'undefined' is not a function (evaluating '$("#form-group > tbody > tr")')
(função anônima) (curriculo, line 865)
[Log] selected operator: iexact (advanced-filters.js, line 58)
[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (http://127.0.0.1:8000/static/easy_select2/vendor/jquery/jquery.js, line 0)
Good enough to me! Now... I'm late to make other changes in my system but I'll be back soon to try to help in developing the project.
Thanks! :D
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.