[Answer]-Accessing to a field in get_object method django in UpdateView

1👍

It looks like you want to fetch the predio_id from the URL, and use it to fetch the object. You can do that with the following:

def get_object(self):
    return get_object_or_404(CreditoPredio, predio_id=self.kwargs['predio_id'])

Leave a comment