Python django.apps.apps 模块,cache_clear() 实例源码

我们从Python开源项目中,提取了以下7个代码示例,用于说明如何使用django.apps.apps.cache_clear()

项目:CodingDojo    作者:ComputerSocietyUNB    | 项目源码 | 文件源码
def _expire_cache(self, forward=True, reverse=True):
        # This method is usually called by apps.cache_clear(), when the
        # registry is finalized, or when a new field is added.
        properties_to_expire = []
        if forward:
            properties_to_expire.extend(self.FORWARD_PROPERTIES)
        if reverse and not self.abstract:
            properties_to_expire.extend(self.REVERSE_PROPERTIES)

        for cache_key in properties_to_expire:
            try:
                delattr(self, cache_key)
            except AttributeError:
                pass

        self._get_fields_cache = {}
项目:djanoDoc    作者:JustinChavez    | 项目源码 | 文件源码
def _expire_cache(self, forward=True, reverse=True):
        # This method is usually called by apps.cache_clear(), when the
        # registry is finalized, or when a new field is added.
        properties_to_expire = []
        if forward:
            properties_to_expire.extend(self.FORWARD_PROPERTIES)
        if reverse and not self.abstract:
            properties_to_expire.extend(self.REVERSE_PROPERTIES)

        for cache_key in properties_to_expire:
            try:
                delattr(self, cache_key)
            except AttributeError:
                pass

        self._get_fields_cache = {}
项目:django-next-train    作者:bitpixdigital    | 项目源码 | 文件源码
def _expire_cache(self, forward=True, reverse=True):
        # This method is usually called by apps.cache_clear(), when the
        # registry is finalized, or when a new field is added.
        properties_to_expire = []
        if forward:
            properties_to_expire.extend(self.FORWARD_PROPERTIES)
        if reverse and not self.abstract:
            properties_to_expire.extend(self.REVERSE_PROPERTIES)

        for cache_key in properties_to_expire:
            try:
                delattr(self, cache_key)
            except AttributeError:
                pass

        self._get_fields_cache = {}
项目:django-wechat-api    作者:crazy-canux    | 项目源码 | 文件源码
def _expire_cache(self, forward=True, reverse=True):
        # This method is usually called by apps.cache_clear(), when the
        # registry is finalized, or when a new field is added.
        properties_to_expire = []
        if forward:
            properties_to_expire.extend(self.FORWARD_PROPERTIES)
        if reverse and not self.abstract:
            properties_to_expire.extend(self.REVERSE_PROPERTIES)

        for cache_key in properties_to_expire:
            try:
                delattr(self, cache_key)
            except AttributeError:
                pass

        self._get_fields_cache = {}
项目:lifesoundtrack    作者:MTG    | 项目源码 | 文件源码
def _expire_cache(self, forward=True, reverse=True):
        # This method is usually called by apps.cache_clear(), when the
        # registry is finalized, or when a new field is added.
        if forward:
            for cache_key in self.FORWARD_PROPERTIES:
                if cache_key in self.__dict__:
                    delattr(self, cache_key)
        if reverse and not self.abstract:
            for cache_key in self.REVERSE_PROPERTIES:
                if cache_key in self.__dict__:
                    delattr(self, cache_key)
        self._get_fields_cache = {}
项目:liberator    作者:libscie    | 项目源码 | 文件源码
def _expire_cache(self, forward=True, reverse=True):
        # This method is usually called by apps.cache_clear(), when the
        # registry is finalized, or when a new field is added.
        if forward:
            for cache_key in self.FORWARD_PROPERTIES:
                if cache_key in self.__dict__:
                    delattr(self, cache_key)
        if reverse and not self.abstract:
            for cache_key in self.REVERSE_PROPERTIES:
                if cache_key in self.__dict__:
                    delattr(self, cache_key)
        self._get_fields_cache = {}
项目:LatinSounds_AppEnviaMail    作者:G3ek-aR    | 项目源码 | 文件源码
def _expire_cache(self, forward=True, reverse=True):
        # This method is usually called by apps.cache_clear(), when the
        # registry is finalized, or when a new field is added.
        if forward:
            for cache_key in self.FORWARD_PROPERTIES:
                if cache_key in self.__dict__:
                    delattr(self, cache_key)
        if reverse and not self.abstract:
            for cache_key in self.REVERSE_PROPERTIES:
                if cache_key in self.__dict__:
                    delattr(self, cache_key)
        self._get_fields_cache = {}