New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Autocomplete question #453
Comments
you need to define autocomplets with your ModelAdmin, see http://django-grappelli.readthedocs.org/en/latest/customization.html#autocomplete-lookups besides, please use the google group for asking questions … this is an issue tracker. |
It seems the autocomplete only works for change-form page. Is there a way to integrate it with search_fields on the change-list page? I do see it is possible with django-autocomplete-light as in |
it does work with the changelist … did you try? |
Yes. Sorry if you feel I am wasting your time, but I have spent a day tinkering with this, and yet it just does not work for me. I managed to make the autocomplete show for fk and m2m on the change form page, but not change-list. Here are my snippets, do you see anything missing? Thanks a lot in advance, Yufei #models.pyclass Place(models.Model): name = models.CharField(max_length=100) parent = models.ForeignKey('self', blank=True, null=True) #admin.pyclass DestinationAdmin(admin.ModelAdmin): # The places field is mentioned in a fieldset list_display = ['id', 'places',] search_fields = ['places',] #list_editable = ['places',] # define the raw_id_fields for Autocomplete Lookups raw_id_fields = ('places',) # define the autocomplete_lookup_fields autocomplete_lookup_fields = { 'fk': ['places'] } Date: Tue, 18 Feb 2014 00:04:15 -0800 it does work with the changelist … did you try? — |
please resend the code in a readable format. |
|
uncomment list_editable — because you want to edit the field, right? |
Not a requirement. Either way autocomplete does not work for me |
yes, it is a requirement … you did not overwrite anything (css, templates)? |
Now I do see: Under my \grappelli_example\static\grappelli\jquery: How do I obtain jquery.min.map? Thanks |
jquery.min.map is not part of grappelli … the question is: why is this file being loaded with your setup? |
no idea. Do you mind if I package my code up and send it over? |
Sorry – I don´t have time to offer that kind of support. Please try to find out what´s the issue … autocompletes are definitely working on the changelist (I just douple-checked with different browsers). I'm closing this ticket for now. If you find something, feel free to reopen. |
Understand. Thanks for your kindness. Date: Tue, 18 Feb 2014 05:28:49 -0800 Sorry – I don´t have time to offer that kind of support. Please try to find out what´s the issue … autocompletes are definitely working on the changelist (I just douple-checked with different browsers). I'm closing this ticket for now. If you find something, feel free to reopen. — |
just one quick question. How do u think I should go about finding it out? It is a very simple app with not much frills except grappelli. My first instinct is the python package I am using, which is the 64x anaconda for 2.7. I am changing to pythonxy now. Do you think this might be the issue? Any other thoughts will be much appreciated. Date: Tue, 18 Feb 2014 05:28:51 -0800 Closed #453. — |
I don´t think the python-package is an issue (I might be wrong though). What I would do:
I would use Firefox or Safari for testing. And always check for js-errors. |
I installed pythonxy on the computer without any python installed previously, and get the same results. so it is not the package. I am wondering why raw_id_fields and related-lookups would not have anything to do here if my goal is to make autocomplete work for the model itself like this:
Is this supposed to show autocomplete, as I start typing in the search box? The grappelli package is excellent, but without some examples/videos I do not know what is supposed to work. Thanks |
Just a sidenote. I just installed Grappelli (2.5.1) with pip, and I also got a 404 on http://localhost:8000/static/grappelli/jquery/jquery.min.map. So I looked a little into it and found out the request is coming from jquery.min.js, see this ticked: http://stackoverflow.com/questions/18365315/jquerys-jquery-1-10-2-min-map-is-triggering-a-404-not-found. |
i came to this issue looking for autocomplete ("suggestions") for search in the change_list. as @sehmaschine correctly said, the "autocomplete lookups" feature does work in the change_list view. it allows you to edit raw_id fields using the same comfortable, autocompleting search widget as in the change_form view. (you have to add the field to imho it was unfortunate to call the staticmethod to define the "lookups" for the "autocomplete lookups" feature autocomplete for the search would be nice... but that is a different story... |
I would also like to have autocomplete working in the search field in the change_list as @fdemmer mentioned. In the meantime I have to rely to other solutions which makes the interface a little inconsistent. |
First time to use Grappelli, so please bear with my very native question.
I am intrigued by the autocomplete feature and added
GRAPPELLI_AUTOCOMPLETE_SEARCH_FIELDS = {
"dry_powder": {
"PositionLevelData": ("Position__icontains",)
}
}
into my settings. My understanding is now when I enter partial names of Position in the search field of the changelist page, my typein will be autocompleted. Yet I see nothing like that. Am I misunderstanding something or missing something?
Thanks for the great work.
The text was updated successfully, but these errors were encountered: