On 15 May 2015 at 09:21, Stephen McDonald <[email protected]> wrote: > > > On Fri, May 15, 2015 at 7:45 AM, Danny <[email protected]> wrote: > >> Hi all, >> >> I'm doing a new development using Mezzanine master and Django 1.8.1, and >> I've got a model that derives from Orderable, >> with appropriate admin stuff set up for it too. >> >> In Mezzanine 3.1.10, the "_order" field was just an integer, so it was >> easy to edit, but with the latest mezzanine, it's now been replaced with >> the wonderful drag-and-drop arrows. Except, for my new model, they don't >> drag and drop! >> > > These have always been drag/drop - the previous behaviour you've seen was > a bug. Likely candidate is JavaScript not being hosted correctly. Anyway > you're now seeing what should have always worked :-) >
Yeah, I realised that - but the bug earlier made it easy to modify the order :D > > >> >> Is there something I'm missing with respect to admin setup, or >> templates/css/js that I need to add so that the new model has the same >> drag/drop functionality as e.g. pages or the inlines for form fields? >> > > Take a look at the models and admin classes in mezzanine.forms that makes > full use of this, particularly the admin class for your inlines: > https://github.com/stephenmcd/mezzanine/blob/master/mezzanine/forms/admin.py#L38 > I think the problem I'm facing is that the Orderable object is a top-level model, not something that's inlined within another model - so it doesn't need the "Add another" part that the Tabular/Stacked Inline Admin templates provide, nor do I need to do the re-ordering within another model. It's probably more akin to Pages, but without the need for the nested hierarchy. I've a feeling I may need to create a new template/javascript that behaves like the inline ordering js, but works on items that are not inlines. I'll do some more investigation. Seeya. Danny. > >> >> I did have a look at, e.g. >> https://github.com/stephenmcd/mezzanine/blob/master/mezzanine/core/static/mezzanine/js/admin/dynamic_inline.js#L43 >> but am not sure if there's something subtle I'm missing that I need to do >> to make it work. >> Is it possible I need to install grapelli_safe from github master as >> well? (I haven't done that yet, just using what's on PyPi) >> >> Thanks, >> >> Seeya. Danny. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Mezzanine Users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> For more options, visit https://groups.google.com/d/optout. >> > > > > -- > Stephen McDonald > http://jupo.org > > -- > You received this message because you are subscribed to the Google Groups > "Mezzanine Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- *Danny Sag* Chairperson Round World Events SA, Inc City of Small Gods Terry Pratchett Fan Club - http://cityofsmallgods.org.au *Nullus Anxietas VI - The Australian Discworld Convention* - http://ausdwcon.org "The Discworld Grand Tour" - Adelaide SA, August 4-6, 2017 -- You received this message because you are subscribed to the Google Groups "Mezzanine Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
