I have a Django app that displays tables on the user end of database queries. I would like the admin to be able to edit those models and objects in table form. Ex: click a value and type in the new value instead of having to click the object and hit save. I’m unsure if there is an easy/conventional way to do this. Thanks!
I like use django-crispy-forms. Flexible solution for use django forms. Easy integrate ajax.
Related
I want to make something like google forms which users can make themselfs. I want just simple html string forms which can reveal answer and check is it right instantly. No matter how users will create forms, but only using webpage. Without additional connecton to DB. Using only one field in column in DB.
Maybe forms can be like this using just html (best variation)
So Django model forms make a multiple choice field out of a many to many field in the model. What I would like to do is to have a plus button similar to that of the admin site, that prompts you with a modal to create a new object for the many-to-many field, instead of just being able to select from the queryset of existing ones. Is mtm the right relation to use? Any pointers on how to achieve this?
An example from the admin page where questions is a manytomany field in the Survey model
Short anwer, use ajax in your template. It will allow you to add a new object without refreshing your page.
If you search stack overflow there will be a lot of examples of how to implement ajax.
I have a table with a foreign key. My problem is that ther's a lot of registers, so I need do that:
But all I've found was for the Admin Panel. Any idea for a custom form without admin?
Raw id, isn't needed any more, since there's autocomplete in the admin. This is also the solution for a model in the frontend. However, you should not bake it yourself, but just use Django Autocomplete Light. An excerpt from the tutorial:
Autocompletes are based on 3 moving parts:
widget compatible with the model field, does the initial rendering,
javascript widget initialization code, to trigger the autocomplete,
and a view used by the widget script to get results from.
I am new to python django and I wanted to ask if there is a suggested way to create an app with ui for the users to be able to create tables on database with models dynamically.
So basically I want the user to fill in the table name and desired column names with types on a form and create them dynamically when they hit submit button. this is for an internal application where we do not want to use the admin panel for implementing it as admin panel will have other elements needed.
any advise or examples shared to take a look and learn along the road building would be a huge help.
Thank you so much for all the support.
I work on a simple app with two basic models, Document and Word. The user uploads a document, and each word from the Document is extracted in a Word entry. The user should be able to view, add, edit and remove the documents and the words, so I thought it would be good to use Django admin. But also the user should be able to do something more with the words, usually in a group of two and some additional adjustable parameters (like calculating Dice similarity).
Is there a way I can do all this in a one-level application? Or I have to make every user admin user, and make an app with just the additional functionality?
You can create custom view in the ModelAdmin or even in the admin site so there is no need to create an additional app.