I'm writing an app for tagging photos. One of the views handles adding new tags and without boilerplate for POST/GET and handling field errors it does this:
tagName = request.cleaned_attributes['tagName']
t = Tag.objects.create(name = tagName)
t.save()
Now in a view for another request to retrieve all tags I have:
tags = Tag.objects.all()
I see the data only after restarting Django development server, which is odd to me. Seems like Tag.objects.all()
has some caching mechanism that is not invalidated properly? The data is for sure saved to the database.
The database backend is sqlite
. I guess I am either missing some configuration or just forgot to do something simple. Ideas?