You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
from abc import ABC
from typing import List
from odmantic import Model, EmbeddedModel, Field
class Address(EmbeddedModel, ABC):
address: str
class TestUser(Model, ABC):
addresses: List[Address]
user = TestUser(addresses=[Address(address='Israel')])
user.addresses[0].address = 'Russia' # will raise AttributeError: __fields_modified__
----------------------------------
Traceback (most recent call last):
File "C:/Users/Benyamin/etc/zmanim_bot/zmanim_bot/api/test.py", line 16, in <module>
user.addresses[0].address = 'Russia' # will raise AttributeError: __fields_modified__
File "C:\Users\Benyamin\.virtualenvs\zmanim_bot-luq9P_0V\lib\site-packages\odmantic\model.py", line 507, in __setattr__
self.__fields_modified__.add(name)
AttributeError: __fields_modified__
The text was updated successfully, but these errors were encountered:
Here is simple example:
The text was updated successfully, but these errors were encountered: