On Jan 9, 2006, at 8:43 AM, Rudolph wrote:
I'm completely new to Django and started some experiments to see if it
fits my needs. Do the object-lists in the admin interface have to
possibility for up/down buttons, to move an object up and down in the
list, by adjusting a sorting value in the database. Inserting and
deleting should also affect this sorting value.
Check out "order_with_respect_to" (http://www.djangoproject.com/
documentation/model_api/#meta-options); that's what you're looking
for. For example:
class PhotoGallery(Model):
...
class Photo(Model):
gallery = ForeignKey(PhotoGallery, edit_inline=TABULAR)
class META:
order_with_respect_to = 'gallery'
Note that the interface for this currently sucks a little bit. I'm
in the process of making it better on the magic-removal branch, though.
Jacob