Giter Site home page Giter Site logo

Comments (5)

devsnd avatar devsnd commented on June 15, 2024 1

I made a quick hack to allow drag'n'drop in the admin by extending the OrderedModelAdmin, see this gist:

https://gist.github.com/devsnd/38b9d4ff573a0611a87f10ab3042db45

Just use DragndropOrderedModelAdmin instead of OrderedModelAdmin when creating your admin class and add make_draggable as list_display item, which renders the necessary HTML/JS into the admin.

It requires the browser to support HTML5 Drag'n'Drop. It's quick and dirty, but it also just works ™

To change item order, just drag the row over another row. The dragged row will then be placed above the row it has been dragged on.

from django-ordered-model.

derek-adair avatar derek-adair commented on June 15, 2024

For what it's worth, I will be making a pass at this and a couple other alternative widgets for ordering models. (I know this is a really... really old issue).

  1. the user re-orders the list in place.
  2. The user drags from an unordered group of objects and creates an ordered list.

from django-ordered-model.

sysradium avatar sysradium commented on June 15, 2024

@derek-adair quite old, but still wanted 👍

from django-ordered-model.

bpartridge avatar bpartridge commented on June 15, 2024

The above hack works like a charm! Added some comments on the gist for anyone looking to implement this.

from django-ordered-model.

lsmith77 avatar lsmith77 commented on June 15, 2024

anyone have it working with a current version?

from django-ordered-model.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.