brechin / django-computed-property

Computed Property Fields for Django

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Will this prevent the field from being directly modified?

simkimsia opened this issue · comments

is this explicitly blocked?

m = MyModel()
m.computed_field = "illegal" # this should be prevented
m.save() # can also throw error here 

You would be able to set the value in the object, but when you call .save() it will re-compute the value in the pre_save signal before it's saved to the database.

I’m experimenting with ur library with another new feature for my own django app.

I’ll close this once I confirm the behavior

Thanks for response 🙏

Sorry been busy will test this by June 3rd please keep this open for another 5 days

Thank you 🙏

I'm going to close this for now, but please re-open if you confirm that it's not behaving as you expected.