djangosnippets.org: Latest snippets tagged with 'inlines'https://djangosnippets.org/tags/inlines/2014-07-22T02:55:17.812399-05:00django admin inlines readonly on change
2014-07-22T02:55:17.812399-05:00mr-africahttps://djangosnippets.org/snippets/3084/<p>Disable editing adding and deleting inline models in django admin on editing parent model</p>
Freely redistributableAdmin page without inlines dinamically
2012-06-16T11:49:20.922772-05:00davmuzhttps://djangosnippets.org/snippets/2770/<p>Sometimes the related objects needs that the main object exists in order to edit and save them properly.
There are two main solutions: override the ModelAdmin.add_view() view or remove the inlines only from the add view page (and not from the change page). The former requires a lot of coding, …</p>
Freely redistributableDrop in dynamic formsets in admin
2010-01-08T10:20:26.350859-06:00justhamadehttps://djangosnippets.org/snippets/1859/<p>A very plugable way to get Stanislaus jquery dynamic formset working in the admin with adding just one template.
Add the following to templates/admin/APP/MODEL/change_form.html and also update the MODEL in the prefix setting.
</p>
<p>Thanks Stanislaus
</p>
<p><a href="http://elo80ka.wordpress.com/2009/10/10/jquery-plugin-django-dynamic-formset/">http://elo80ka.wordpress.com/2009/10/10/jquery-plugin-django-dynamic-formset/</a>
</p>
<p><a href="http://go2.wordpress.com/?id=725X1342&site=elo80ka.wordpress.com&url=http%3A%2F%2Fcode.google.com%2Fp%2Fdjango-dynamic-formset%2F">http://go2.wordpress.com/?id=725X1342&site=elo80ka.wordpress.com&url=http%3A%2F%2Fcode.google.com%2Fp%2Fdjango-dynamic-formset%2F</a>
</p>
<p><a href="http://www.djangosnippets.org/snippets/1389/">http://www.djangosnippets.org/snippets/1389/</a>
</p>
Freely redistributableDynamic tabular inlines with optional drag-n-drop sorting
2009-05-05T15:44:41.360837-05:00Aneonhttps://djangosnippets.org/snippets/1489/<p>This jQuery javascript enables dynamic add/delete of rows in tabular inlines. It adds a "+" icon at the bottom of the inline to allow addition of new rows, and replaces the default delete checkbox with a "x" icon for deletion, giving you the possibility to add/delete rows instantly without reloading …</p>
Freely redistributableOrderable inlines using drag and drop with jQuery UI
2008-09-13T05:35:43.339956-05:00simonhttps://djangosnippets.org/snippets/1053/<p>An easy way of making inlines orderable using drag-and-drop, using <a href="http://ui.jquery.com/">jQuery UI's</a> sortable() plugin.</p>
<p>First, add an "order" field to the inline models which is an IntegerField, and set that model to use 'order' as its default order_by.</p>
<p>Then hook in the JavaScript. This should make them drag-and-drop sortable using …</p>
Freely redistributable