# Object id changes in Django Reverse function

**URL:** https://forum.codewithmosh.com/t/object-id-changes-in-django-reverse-function/14129
**Category:** Django
**Created:** [August 4, 2022, 4:20am UTC](https://forum.codewithmosh.com/t/object-id-changes-in-django-reverse-function/14129 "2022-08-04T04:20:10Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![farbod](https://avatars.discourse-cdn.com/v4/letter/f/a8b319/32.png) [@farbod](https://forum.codewithmosh.com/u/farbod)
#### Post date: [August 4, 2022, 4:20am UTC](https://forum.codewithmosh.com/t/object-id-changes-in-django-reverse-function/14129/1 "2022-08-04T04:20:10Z")

</div>

Hi,  
I’ve started to learn django with Mosh course and it’s very good, but I faced with a problem in admin section,  
when I want to add a history for one of my models in their admin change list get this error  
“NoReverseMatch at /admin/ticketing/ticket/”

It seems the object id returns as a tuple, I have the same problem for another model too, but in my third model this doesn’t happen.

this is code :  
@admin.register(models.Ticket)  
class TicketAdmin(admin.ModelAdmin):  
actions = [‘change\_status\_to\_close’]  
autocomplete\_fields = [‘member’]  
list\_display = [‘id’,‘member’,‘title’,‘create\_time’,‘last\_update’,‘status’,‘history’]  
list\_editable = [‘status’]  
list\_filter = [‘status’,(‘create\_time’,DateTimeRangeFilter),  
(‘last\_update’,DateTimeRangeFilter)]  
list\_per\_page = 20  
search\_fields = [‘id’]  
sortable\_by = [‘create\_time’,‘last\_update’,‘id’,‘status’]

```
@admin.display()
def history(self,ticket):
    url = reverse('admin:ticketing_ticket_history',args=str(ticket.id))
    return format_html('<a href="{}">History</a>', url)

```

here is the error:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/codewithmosh/original/2X/4/451929e2ed18f4bf121d76d9e7f3066ff4d644ef.png)

Thank you if you can advise
