question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Import/Export admin buttons not showing up if another mixin is loaded first

See original GitHub issue

Howdy,

I’m facing an issue where the import/export buttons don’t show up in the admin page (Django 1.9) if I have another mixin loaded first.

The mixin being loaded first is from django-advanced-filters: https://github.com/modlinltd/django-advanced-filters/blob/develop/advanced_filters/admin.py#L57

eg.

class WhateverAdmin(AdminAdvancedFiltersMixin, ImportExportMixin, admin.ModelAdmin):
    pass

Anyone ever experienced that?

Thanks.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
hermanocabralcommented, May 9, 2022

@taut-and-yare It was so long ago that I barely remember what I did, but as far as I recall there was something missing in the template and I just had to add it there to work.

1reaction
taut-and-yarecommented, May 9, 2022

@matthewhegarty FYI, the problem persists with 3.0.0 I managed to get it to work by adding one include tag in the template mentioned above: admin/advanced_filters.html:

{% block object-tools-items %}
  {% include "admin/import_export/change_list_import_item.html" %}
  {{ block.super }}
  {# Add a link to the end of the tool items #}
  {% if advanced_filters %}
	<li><div class="afilters">
		<a class="ajax-popup-link icons-object-tools-add-link" href="#advanced_filters" >{% trans "Advanced Filter" %}</a>{% if '_afilter' in request.GET %}<a class="edit-link" href="{% url 'admin:advanced_filters_advancedfilter_change' current_afilter %}" >{% trans "Edit" %}</a>{% endif %}
</div></li>
  {% endif %}
{% endblock object-tools-items %}
Read more comments on GitHub >

github_iconTop Results From Across the Web

django-import-export not showing in admin - Stack Overflow
Problem is there is no solution for the problem posted there and I need it badly. Buttons for import/export in my admin panel...
Read more >
modlinltd/django-advanced-filters - Gitter
I'm facing an issue where the advanced filter button doesn't show up in the admin page if I have another mixin loaded first....
Read more >
django-import-export Documentation - Read the Docs
export data respecting admin filters. Fig. 1: A screenshot of the change view with Import and Export buttons. User Guide.
Read more >
Import or Export buttons unavailable for a Data Extension
Hover over the Welcome [Username] section on the top right-hand side of the page; Click 'Setup'; Go to Users | Users; Check the...
Read more >
How to Add Custom Action Buttons to Django Admin
We are big fans of the Django admin interface. It's a huge selling point for Django as it takes the load off developing...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found