Hi Patrick.

I've been planing to implement this, but haven't found the time to. I
know code speaks louder than words... but I've done some thought over
this and would like to share my opinions.



> 1. right now, you can drag & drop table rows within the change-list.
> NOT every action is stored immediately (to the database) - instead you
> ´re having two buttons (SAVE/CANCEL) at the bottom of the page. after
> you´re finished with dragging stuff around you may click SAVE - then,
> the page reloads ...
> question: would you prefer instant saving?
live saving would be nice, but it opens up a few problems. I think
having a 'batch' save will avoid many headaches.
>
> 2. the table-column which is affected is currently named "position" -
> any other suggestions?
>
hm.. I am -1 on this one.
Ideally you would be able to specify in your model if you want it to be
draggable and with which field.

let's say you've got these models
class SlideShow(Model):
        title = CharField(maxlength=60)

class Slide(Model):
        slideshow = ForeignKey(SlideShow)
        image = ImageField(upload_to='some_dir')
        order = IntegerField()

        class Admin:
                draggable_by = 'order'

It would probably be cleaner  to set this in the Admin inner class.
It would make it easer to integrate legacy dbs and also avoid name
clashes.
Also this would make it explicit, which is good.

> 3. within the change-list, you´re probably having filters and other
> stuff which is not necessary for DnD-action. would you prefer a
> button "REORDER" at the top of the page (e.g. within the object-
> tools) which links to another page specifically designed for DnD-
> stuff. if so, any ideas on how to get that button for certain tables
> (because not every table needs reordering)? e.g. with extending class
> admin?
>
I'm not in favor of having another page for this. Too cumbersome. Maybe
if the model specifies it allows dragging you could on top (or bottom)
of the change-list table have a text that says "Drag rows to reorder".
Once you have a successful drop you could hide that text(with js) and
change it to your buttons "SAVE ORDER" "REVERT ORDERING"(or something
like that).
> 4. do you prefer dragging the whole table-row or do you prefer having
> a button for dragging (e.g. within the last column on the right hand
> side)?
I am +1 on the whole row.
>
> any other suggestions/feedback?

> ### after the first drag, you are not able to click the link for the
> detail-page anymore. I´m not sure if this is a bug or if it´s
> intended. either way, also not good. having that in mind, it´d
> probably be better to have a different page for reordering (see above).
>
How are you handling events? Maybe if you use event bubbling you can
check if the click came from the details link and suppress dragging in
that case?

Thanks for getting this rolling...

cheers arthur


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to