Python django.core.serializers._serializers() Examples

The following are 11 code examples of django.core.serializers._serializers(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module django.core.serializers , or try the search function .
Example #1
Source File: signals.py    From GTDWeb with GNU General Public License v2.0 5 votes vote down vote up
def clear_serializers_cache(**kwargs):
    if kwargs['setting'] == 'SERIALIZATION_MODULES':
        from django.core import serializers
        serializers._serializers = {} 
Example #2
Source File: signals.py    From bioforum with MIT License 5 votes vote down vote up
def clear_serializers_cache(**kwargs):
    if kwargs['setting'] == 'SERIALIZATION_MODULES':
        from django.core import serializers
        serializers._serializers = {} 
Example #3
Source File: signals.py    From Hands-On-Application-Development-with-PyCharm with MIT License 5 votes vote down vote up
def clear_serializers_cache(**kwargs):
    if kwargs['setting'] == 'SERIALIZATION_MODULES':
        from django.core import serializers
        serializers._serializers = {} 
Example #4
Source File: signals.py    From python with Apache License 2.0 5 votes vote down vote up
def clear_serializers_cache(**kwargs):
    if kwargs['setting'] == 'SERIALIZATION_MODULES':
        from django.core import serializers
        serializers._serializers = {} 
Example #5
Source File: signals.py    From luscan-devel with GNU General Public License v2.0 5 votes vote down vote up
def clear_serializers_cache(**kwargs):
    if kwargs['setting'] == 'SERIALIZATION_MODULES':
        from django.core import serializers
        serializers._serializers = {} 
Example #6
Source File: signals.py    From openhgsenti with Apache License 2.0 5 votes vote down vote up
def clear_serializers_cache(**kwargs):
    if kwargs['setting'] == 'SERIALIZATION_MODULES':
        from django.core import serializers
        serializers._serializers = {} 
Example #7
Source File: signals.py    From python2017 with MIT License 5 votes vote down vote up
def clear_serializers_cache(**kwargs):
    if kwargs['setting'] == 'SERIALIZATION_MODULES':
        from django.core import serializers
        serializers._serializers = {} 
Example #8
Source File: tests.py    From djongo with GNU Affero General Public License v3.0 5 votes vote down vote up
def setUp(self):
        self.old_serializers = serializers._serializers
        serializers._serializers = {} 
Example #9
Source File: tests.py    From djongo with GNU Affero General Public License v3.0 5 votes vote down vote up
def tearDown(self):
        serializers._serializers = self.old_serializers 
Example #10
Source File: test_yaml.py    From djongo with GNU Affero General Public License v3.0 5 votes vote down vote up
def setUpClass(cls):
        """Removes imported yaml and stubs importlib.import_module"""
        super().setUpClass()

        cls._import_module_mock = YamlImportModuleMock()
        importlib.import_module = cls._import_module_mock.import_module

        # clear out cached serializers to emulate yaml missing
        serializers._serializers = {} 
Example #11
Source File: test_yaml.py    From djongo with GNU Affero General Public License v3.0 5 votes vote down vote up
def tearDownClass(cls):
        """Puts yaml back if necessary"""
        super().tearDownClass()

        importlib.import_module = cls._import_module_mock._import_module

        # clear out cached serializers to clean out BadSerializer instances
        serializers._serializers = {}