just found this ticket (http://code.djangoproject.com/ticket/8165)
which is probably the reason why (re-)ordering edit-inlines is so
complicated.


On Oct 21, 3:43 pm, patrickk <[EMAIL PROTECTED]> wrote:
> does anyone know about a clean way to order edit-inlines using the
> admin-interface?
>
> 1. I´ve seen this and other javascript-based 
> snippets:http://simonwillison.net/2008/Sep/13/django/... it´s quite simple,
> but it doesn´t really work. for example, if the formset isn´t valid,
> the order is lost. every js-solution I´ve came across is not able to
> deal with errors on the page ...
>
> 2. I´ve tried to use a custom formset (see code below). but even if
> you define can_order for a formset, you won´t get the ordering_field
> for the form.
>
> class OrderedInline(BaseInlineFormSet):
>     def __init__(self, *args, **kwargs):
>             super(OrderedInline, self).__init__(*args, **kwargs)
>             self.can_delete = True
>             self.can_order = True
>
> class PhotoGalleryInline(admin.StackedInline):
>     model = PhotoGalleryItem
>     extra = 3
>     formset = OrderedInline
>     fieldsets = .....
>
> 3. in my opinion, using order_with_respect_to is the right way to go,
> but it´s not supported by the admin-interface. if you use
> order_with_respect_to, can_order is still false.
>
> hope that anyone can give me a hint on this one. please note that I´m
> seeking a clean solution and not some kind of weird hack.
>
> thanks,
> patrick.
--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to