[Fixed]-Using property for django fields causes infinite loop

1👍

your property’s name is the same name as the model field. it should be:

@property
def loc_latitude_prop(self):
    return self.loc_latitude

@loc_latitude_prop.setter
def set_loc_latitude(self, value):
    #...

otherwise they start calling each other and you get stuck in infinite loop..

but I would not use properties in django, because django does not recognize these in ORM, it only knows django fields

Leave a comment