Get In Touch
TC 73/1214,Enchakal
Vallakadavu(PO), Thiruvananthapuram,
Kerala- 695008.

Django get_object() takes exactly 3 arguments (4 given)

when you override get_object() method in model admin Django 1.8 version we will get error message, django get_object() takes exactly 3 arguments (4 given)

In Django 1.8 you need to pass attribute  from_field

 

def get_object(self, request, object_id, from_field=None):
    obj = super(MyModelAdmin, self).get_object(request, object_id)
    if obj is not None:
        obj.myfield = obj.category.split("|")
    return obj

 

This website stores cookies on your computer.

START A CONVERSATION

Please enable JavaScript in your browser to complete this form.

Junior Scrum Master

Business Development Executive

Business Operation Analyst

Senior Python Django Developer

Technical Project Manager

React JS Developer

MBA Fresher Recruitment ( 2022 & 2023 passed out)