Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reusing Admin forms for user views in django?

Django is making very nice forms after creating a models.py and an admin.py.

How can I reuse these forms (with the extra nice handling of foreign keys and many-to-many fields) in my own views?

ModelForm does only generate "simple" forms. Where do I get the extra batteries?

like image 770
toaster Avatar asked Oct 28 '09 15:10

toaster


People also ask

Can Django admin be used in production?

Django's Admin is amazing. A built-in and fully functional interface that quickly gets in and allows data entry is priceless. Developers can focus on building additional functionality instead of creating dummy interfaces to interact with the database.

Can we change Django admin theme?

To do so, you will have to change the project's settings.py . Find the TEMPLATES section and modify accordingly. To override the default template you first need to access the template you want to modify from the django/contrib/admin/templates/admin directory.

Is Django's admin interface customizable if yes then how?

The Django framework comes with a powerful administrative tool called admin. You can use it out of the box to quickly add, delete, or edit any database model from a web interface. But with a little extra code, you can customize the Django admin to take your admin capabilities to the next level.

What is admin ModelAdmin in Django?

One of the most powerful parts of Django is the automatic admin interface. It reads metadata from your models to provide a quick, model-centric interface where trusted users can manage content on your site. The admin's recommended use is limited to an organization's internal management tool.


1 Answers

I was actually able to replicate those green buttons in my forms by following the instructions on this page: http://www.hoboes.com/Mimsy/hacks/replicating-djangos-admin/

like image 132
buken Avatar answered Sep 28 '22 17:09

buken