This requires JS and is pretty tied to *your* toolkit of choice. As
most sites already rely on one of the toolkits, Django can't depend on
any of them (at least outside of default admin templates) and
providing lengthy DOM-based widgets is a waste of time (as the site
will likely have to replace them with themed and toolkit-powered
ones). This falls outside of Django's scope.
If you need ordered lists, create models that include a sorting field.
> === ManyToMany Fields ===
>
> The above would be very useful for values stored in the database as
> well. It would be nice to have an OrderedManyToMany Field. That would
> assume that the intermediate table for a a many-to-many relationship
> would also have a column for storing the order. One could use the id
> column of the intermediate table. Do you agree that it could be very
> simple to write an OrderedManyToMany Field, but simply adding the up/
> down feature to the widget?
See above, use an explicit connecting model for many-to-many relations
and add tour sorting fields there.
--
Patryk Zawadzki
PLD Linux Distribution
I understand the need to be toolkit agnostic, but could we not take a
similar approach as the Ext js framework, where by you can use one of
many existing frameworks as your base. Then the django community can
build connectors as demanded.
I understand there are some complexities involved, but essentially its
just creating a uniform javascript API to use - not unlike the may we
have a uniform database api.
--
Jonathan Swift - "May you live every day of your life."
That's a gross understatement. :-)
The various Javascript toolkits vary wildly in their implementations;
any API attempting to unify them would necessarily become a
toolkit-onto-itself, which is *way* out of Django's scope. Many of us
probably wish that our favorite toolkit would simply be blessed for
the admin and whatnot (yay jQuery!), but that would likely become the
largest flamewar in Django history. :p
Totally agreed.
> Many of us
> probably wish that our favorite toolkit would simply be blessed for
> the admin and whatnot (yay jQuery!), but that would likely become the
> largest flamewar in Django history. :p
I don't think so. As long as I'm not the author of django admin, I
don't really care what JS is uses as long as it works and the JS not
intrusive (like date and time pickers attach themselves upon page load
and are not part of the widget).