# I have added order\_with\_respect\_to in a Model. How to set order through admin?

**URL:** <https://forum.djangoproject.com/t/i-have-added-order-with-respect-to-in-a-model-how-to-set-order-through-admin/27643>\
**Category:** The Admin\
**Created:** [February 1, 2024, 8:52am UTC](https://forum.djangoproject.com/t/i-have-added-order-with-respect-to-in-a-model-how-to-set-order-through-admin/27643 "2024-02-01T08:52:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![petasis](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/petasis/32/6393_2.png) [@petasis](https://forum.djangoproject.com/u/petasis)\
**Post date:** [February 1, 2024, 8:52am UTC](https://forum.djangoproject.com/t/i-have-added-order-with-respect-to-in-a-model-how-to-set-order-through-admin/27643/1 "2024-02-01T08:52:37Z")

</div>

Hi all,

I have a model named Activity, and a set of ActivitySteps:

```auto
class Activity(models.Model):
    name = models.CharField(max_length=512, default=None)

class ActivityStep(models.Model):
    name = models.CharField(max_length=512, default=None)
    activity = models.ForeignKey('Activity', on_delete=models.CASCADE, default=None, null=False, blank=False)
    class Meta:
        order_with_respect_to = "activity"

```

Now my question is:  
Is there an admin interface that will allow to set the ordering of steps in activities through the admin UI?

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [February 1, 2024, 3:34pm UTC](https://forum.djangoproject.com/t/i-have-added-order-with-respect-to-in-a-model-how-to-set-order-through-admin/27643/2 "2024-02-01T15:34:43Z")

</div>

I’m not aware of any Django-provided solution for this.

You might want to look at third-party packages that may provide this feature. [Check out `djangopackages.org`](https://djangopackages.org/grids/g/admin-interface/) for some possibilities. (See django-admin-sortable2)

If you don’t find anything suitable, you can implement one yourself.

It would need to be some type of JavaScript widget to allow for the ordering of the fields combined with something in Django that expects that order and knows what to do with it.

_That_ implies to me that it would need to be implemented in a custom form using that JavaScript widget, with an overridden `save_model` method to call the `set_RELATED_order` method.

Even if you don’t want to use an existing third-party-package, it would probably be worth your time to read the code to see how they work.
