[Fixed] Model Class Property Setters

I have a model class with a property. Reading that property works just fine.

However, if I add a setter, it never gets called.

Is that expected behaviour?

Here’s an MWE:

The code for that is just this plus a table so the model class can be defined:

from anvil.tables import app_tables


class ToDo(app_tables.todo.Row, attrs=True, buffered=True):

    @property
    def test(self):
        return "hello"

    @test.setter
    def test(self, value):
        print(value)



task = ToDo()
print(task.test)

task.test = "world"

It prints hello as expected but not world

Yeap looks like we’re not following python semantics properly
We’ll get that fixed

4 Likes

Excellent! Thank you.

1 Like