tastypie api does't support upload file, so I have to use normal view function,check out my other question
this is my image resource
class ImageResource(ModelResource):
album = fields.ForeignKey(AlbumResource, 'album')
upload_by = fields.ForeignKey(UserResource, 'upload_by')
class Meta:
always_return_data=True
filtering = {
"album": ('exact',),
}
queryset = Image.objects.all()
cache = SimpleCache(timeout=100)
resource_name = 'image'
authorization = ImageAuthorization()
now suppose I upload an image in normal view function, because I set the cache timeout to 100 sec, the browser won't update the query in 100sec.
what I want is browser update the query immediately after the image uploaded, and keep cache timeout to 100 sec if nothing changed.and this have to be done in normal view function.
How can I do this?