This is my fault. When I execute "cache.set(key, model_instance)", the model
instance hasn't get the cache content.
林挺滨 于2018年6月28日周四 下午1:33写道:
> I use cache api to keep model instances, but "@cache_property" isn't
> work. Now I use the module global var to keep model instances.
>
> 赖信桃 于2018年6
I use cache api to keep model instances, but "@cache_property" isn't work.
Now I use the module global var to keep model instances.
赖信桃 于2018年6月28日周四 下午1:29写道:
> One is cached framework , one is just a better "property". Use cache api
> if you want to keep some instances.
> On Thu, Jun 28, 2018
One is cached framework , one is just a better "property". Use cache api if
you want to keep some instances.
On Thu, Jun 28, 2018 at 13:11 林挺滨 wrote:
>
> https://docs.djangoproject.com/zh-hans/2.0/ref/utils/#module-django.utils.functional
> Say:
> The cached result will persist as long as the in
https://docs.djangoproject.com/zh-hans/2.0/ref/utils/#module-django.utils.functional
Say:
The cached result will persist as long as the instance does, so if the
instance is passed around and the function subsequently invoked, the cached
result will be returned.
https://docs.djangoproject.com/zh-h
Django's cached framework and @cached_property are two different things,
though both has "cached" it doesn't mean that they share memory
https://docs.djangoproject.com/zh-hans/2.0/topics/cache/
https://docs.djangoproject.com/zh-hans/2.0/ref/utils/#module-django.utils.functional
Read the docs.
class Log(models.Model):
type = models.CharField(max_length=200, unique=True)
column = SortedManyToManyField(Column, blank=True)
min_column_cnt = models.IntegerField(blank=True, default=0,
help_text='0 equal NULL')
@cached_property
def column_list_name(self):
return [co
Show me your code snippet.
林挺滨 于2018年6月27日周三 下午8:44写道:
> When I use cache framework api to cache a model instance, @cached_property
> of the instance doesn't work. Why?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe fro
When I use cache framework api to cache a model instance, @cached_property
of the instance doesn't work. Why?
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to d
8 matches
Mail list logo