In order to monitor mysql table change in django, I have written some codes as follows,
while not find_close_signal():
time.sleep(10)
if MyProject.models.MyModel.objects.all().exists():
some_execution()
However, it doesn't work. If there is no entries in the table at the beginning, then some_execution() will never run even later there are records populated into that table through other out-band ways.
Does anyone ever meet such kind of issue?
I also found in "manage.py shell", this problem happens exactly the same: any other entries added into db out of this shell can not be found in this shell. Is this true or I've made some mistake? Thanks