I have a stackedinline Django admin. This is used to add multiple products for a shop. However, when I click on 'Save and add another' it sometimes shows 'Entity too large', even when the files are below the allowed size, or sometimes it shows 'DATA_UPLOAD_MAX_NUMBER_FIELDS' error. My question is, does Django stackedinline admin save each and every object each time we click on save? If no, then what could be the reason for this error?
StackedInline is saved only when you click on main save.
It does save all through building the formsets and it does not use ajax requests for each of the rows -> source
Also you can easily check this by inspecting and opening network tab
Related
I am trying to develop a website where I can see the homepage as it is from Django admin panel. The reason I want that is I want to edit the name of the static content like 'Home' to 'All' along with the change of slide show picture. In summary, I want to change the website layout from Django admin panel that is not accessible to users. Is that possible? I just want an idea of how to implement the process.
Static texts you can change in admin panel with different modules:
for example django-rosetta or my own library Django-tof. https://github.com/wP-soft-GmbH/django-tof
But in your case, i think, you want to made something more.
For this case you can use django-flat-pages, already included in Django, if you have a static web-page.
you can edit every element on the page and after save, you can see it on the front.
if you really want to change the django templates, which you use in your views, you can create a simple template editor in the admin panel based on a widget like django-Ckeditor.
Consider a model that stores application forms. I would like to use Django admin to quickly view applications and change their status. I would like to be able to change the status of an application right in the view listing all the applications without having to open each application for editing. So, is it possible to make a field editable right in the admin list view?
I'm building a webpage that use ModelForm with ManyToMany relations. The Admin of django has the useful RelatedFieldWidgetWrapper. It creates a + next to relationfields that, when pressed, opens a popup to create a related-object. Once the creation is made the main webpage (the one where we press the +) has the new item loaded.
Now, in my website I would like to have something similar, my questions are:
is it correct to use the RelatedFieldWidgetWrapper in a webpage outside admin?
how does the page autoloads the new content (this is mainly my curiosity)
any other applicable solution to have a handy form without requiring complex JS or several pages?
thanks
I do want to know how to add button in django admin site.I tried many stuff but I couldn't able to do the stuff.I want to add a reset button for an attribute in the model where it should regenerate the value for the attribute.
You're going to have to edit the admin files to add this button, it may be easier to inject a piece of JavaScript code and a button into the admin template to reset the form fields.
We're using Django 1.4's new wizard to create, well, a wizard. We have a wizard where, a few steps into it, the user has to select a row from a listview/datagrid/table. We use Django-tables2 to show this data.
The problem is that django's wizard has a single fixed URL, and uses a hidden form field that tells the wizard at what step it is. So all forms submit via POST back to the very same URL, and Django's wizard figures out from which page the user comes, stores the submitted data and based on the hidden form field, figures out where to go next.
Django-tables2 is an HTML grid that supports paging and sorting through a set of data. However, it does so using http GET, passing some querystring variables to indicate what column to sort and/or what "page" of data to show.
As soon as we use sorting or paging in a tables2 grid inside a Django wizard, the GET will call the same URL, because it is a GET, the Django wizard will not receive the hidden form values it expects that regulates navigation, and it will happily show the first page of the wizard by default.
I'm wondering if anyone has experience with this and knows of a solution to keep both the Django Wizard as well as the Tables2 functional.
Thanks in advance,
Erik