Giter Club home page Giter Club logo

Comments (8)

zN3utr4l avatar zN3utr4l commented on May 26, 2024 1

the error persists, it seems to be a django error

from django-admin-interface.

fabiocaccamo avatar fabiocaccamo commented on May 26, 2024

@zN3utr4l could you try please to disable the tabbed fieldset option to check if the problem is present even with the default fieldset?

from django-admin-interface.

zN3utr4l avatar zN3utr4l commented on May 26, 2024

image

even without the tabbed fieldset the first fieldset block has no form, maybe it's a django related error?

from django-admin-interface.

fabiocaccamo avatar fabiocaccamo commented on May 26, 2024

@zN3utr4l if the problem persists even without the tabbed subset there are two possibilities:

  • you are doing something wrong
  • it's a django related error

Maybe you can try to reduce what you are doing to a minimal test to understand the cause.

from django-admin-interface.

zN3utr4l avatar zN3utr4l commented on May 26, 2024

Maybe you can try to reduce what you are doing to a minimal test to understand the cause

admin.py

readonly_fields = ('test_btn', 'test_btn2')
fieldsets = (
    ('test', {
        'classes': ('collapse', 'expanded'),
        'fields': ('test_btn',)
    }),
    ('test2', {
        'classes': ('collapse', 'expanded'),
        'fields': ('test_btn2',)
    })
)

def test_btn(self, obj):
    return format_html('<input type="submit" value="test_btn" name="_test_btn">')

def test_btn2(self, obj):
    return format_html('<input type="submit" value="test_btn2" name="_test_btn2">')

templates/admin/includes/fieldset.html

wrap all code in:

<form {% if has_file_field %}enctype="multipart/form-data" {% endif %}{% if form_url %}action="{{ form_url }}" {% endif %}method="post" id="{{ opts.model_name }}_form" novalidate>{% csrf_token %}{% block form_top %}{% endblock %}

</form>

if show_fieldsets_as_tabs templates/admin/change_form.html

wrap this code:

<div id="tabcontent-{{ tab_name|admin_interface_slugify }}" class="tabbed-changeform-tabcontent {{ forloop.counter0|default:'active' }}">
    {% include "admin/includes/headerless_fieldset.html" %}
</div>

from django-admin-interface.

fabiocaccamo avatar fabiocaccamo commented on May 26, 2024

The problem is that {% block form_top %}{% endblock %} is rendered empty only for the last fieldset right?

from django-admin-interface.

zN3utr4l avatar zN3utr4l commented on May 26, 2024

No, the problem is the first fieldset, only {% csrf_token %} is rendered

Good:
image

Not Good:
image

From this image you can see all fieldsets enclosed in the form except the first one
image

from django-admin-interface.

fabiocaccamo avatar fabiocaccamo commented on May 26, 2024

If you remove "admin_interface" from settings.INSTALLED_APPS, does this problem persists?

from django-admin-interface.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.