# Django: how to update order tracker model using Django?

**URL:** <https://forum.djangoproject.com/t/django-how-to-update-order-tracker-model-using-django/20186>\
**Category:** Getting Started\
**Created:** [April 11, 2023, 7:05pm UTC](https://forum.djangoproject.com/t/django-how-to-update-order-tracker-model-using-django/20186 "2023-04-11T19:05:08Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![desphixs](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/desphixs/32/6411_2.png) [@desphixs](https://forum.djangoproject.com/u/desphixs)\
**Post date:** [April 11, 2023, 7:05pm UTC](https://forum.djangoproject.com/t/django-how-to-update-order-tracker-model-using-django/20186/1 "2023-04-11T19:05:08Z")

</div>

I am trying to build an order tracker using django, to track the delivery status and location of a order made by a buyer.  
i have a model that look like this

```auto
class OrderTracker(models.Model):
    order_item = models.ForeignKey('store.CartOrderItem', on_delete=models.SET_NULL, null=True, related_name="cartorderitem_tracker")
    status = models.CharField(max_length=5000, null=True, blank=True)
    location = models.CharField(max_length=5000, null=True, blank=True)
    activity = models.CharField(max_length=5000, null=True, blank=True)
    date= models.DateField(auto_now_add=True)

def __str__ (self):
    return self.order_item

```

When an order gets placed, the status of the `OrderTracker` changes to shipping.  
How do i update the location with the current location where the order is crrently and also the activity _(activity is something like: “Left Warehouse”)_

Should this is updated manully by the vendor in the dashboard, or do i need like an API to implement this feature

---

<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:** [April 11, 2023, 7:11pm UTC](https://forum.djangoproject.com/t/django-how-to-update-order-tracker-model-using-django/20186/2 "2023-04-11T19:11:08Z")

</div>

That’s a decision for you to make in coordination with your vendor(s).

If you create an API, then it’s up to them to build something allowing their staff to submit the updates.

If you give them a link to update the status of an order, then it’s up to you to provide the necessary views and templates.

Or you can do both - create an API and a page that submits through that API.  
if you’re working with multiple vendors, they may have an existing system that they wish to integrate with your system. Or, if they’re a small vendor, they may not have the staffing to do that work and would prefer regular page they can update.

There’s no _technical_ reason to choose one over the other, it’s a business decision.

---

<div class="post-metadata">

**Author:** ![desphixs](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/desphixs/32/6411_2.png) [@desphixs](https://forum.djangoproject.com/u/desphixs)\
**Post date:** [April 11, 2023, 7:19pm UTC](https://forum.djangoproject.com/t/django-how-to-update-order-tracker-model-using-django/20186/3 "2023-04-11T19:19:59Z")

</div>

Thanks for your response Mr. Ken

Right now, there are small vendors, and i already have a simple view and template where they can update only the `delivery_status` of the product.

But, is it okay if i allow them to also update the location and activity of the current product (they may get this information from the shipping company there are using to ship the item to the buyer then update it in the using the form i have provided)??

---

<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:** [April 11, 2023, 7:24pm UTC](https://forum.djangoproject.com/t/django-how-to-update-order-tracker-model-using-django/20186/4 "2023-04-11T19:24:13Z")

</div>

Again, that’s a business decision, not a technical decision.

You can allow those vendors to update whatever you want them to update.

It’s your decision to make regarding what they’re allowed to change. You need to figure out what’s going to work best for your business.

Now, you might want to do things like define buttons or use select fields instead of using a text input field for some values, but that’s all really up to you.

---

<div class="post-metadata">

**Author:** ![desphixs](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/desphixs/32/6411_2.png) [@desphixs](https://forum.djangoproject.com/u/desphixs)\
**Post date:** [April 11, 2023, 7:44pm UTC](https://forum.djangoproject.com/t/django-how-to-update-order-tracker-model-using-django/20186/5 "2023-04-11T19:44:08Z")

</div>

Okay, thank you very much for your time.
