django-orderable-inlines

Drag-to-reorder inline model admins for Django
Download

django-orderable-inlines Ranking & Summary

Advertisement

  • Rating:
  • License:
  • BSD License
  • Price:
  • FREE
  • Publisher Name:
  • Elijah Rutschman
  • Publisher web site:
  • http://github.com/elijahr/

django-orderable-inlines Tags


django-orderable-inlines Description

django-orderable-inlines is a Django app that can be used to drag-to-reorder inline model admins for Django.Installation pip install django-orderable-inlinesAdd orderable_inlines to your INSTALLED_APPS.Examplemodels.py:from django.db import modelsclass Gallery(models.Model): name = models.CharField(max_length=16)class Photo(models.Model): gallery = models.ForeignKey(Gallery) image = models.ImageField(upload_to='gallery_photos') order = models.PositiveIntegerField(default=1)admin.py:from django.contrib import adminfrom gallery.models import Gallery, Photofrom orderable_inlines import OrderableTabularInlineclass PhotoInline(OrderableTabularInline): model = Book orderable_field = 'order'class GalleryAdmin(admin.ModelAdmin): inlines = admin.site.register(Gallery, GalleryAdmin)Product's homepage


django-orderable-inlines Related Software