# Path: pyston/utils/compatibility.py
# def get_field_or_none(model, field_name):
# def get_all_related_objects_from_model(model):
# def get_concrete_field(model, field_name):
# def is_reverse_many_to_one(model, field_name):
# def is_reverse_one_to_one(model, field_name):
# def is_reverse_many_to_many(model, field_name):
# def is_many_to_one(model, field_name):
# def is_one_to_one(model, field_name):
# def is_many_to_many(model, field_name):
# def is_relation(model, field_name):
# def get_model_from_relation(model, field_name):
# def get_model_from_relation_or_none(model, field_name):
# def get_reverse_field_name(model, field_name):
# def get_last_parent_pk_field_name(obj):
# def delete_cached_value(instance, field_name):


import types
import sys
import datetime
import decimal
import uuid
from io import BytesIO
from django.utils.encoding import force_bytes
from django.conf import settings
from django.utils.duration import duration_iso_string
from django.utils.functional import Promise
from django.utils.timezone import is_aware
from chamber.utils import get_class_method
from .compatibility import FieldDoesNotExist
    from pyston.serializer import LAZY_SERIALIZERS
        if data.microsecond:
            r = r[:12]
        return r
    elif isinstance(data, datetime.timedelta):
        return duration_iso_string(data)
    elif isinstance(data, (decimal.Decimal, uuid.UUID, Promise)):
        return str(data)
    else:
        return data


def str_to_class(class_string):
    module_name, class_name = class_string.rsplit('.', 1)
    # load the module, will raise ImportError if module cannot be loaded
    m = __import__(module_name, globals(), locals(), str(class_name))
    # get the class, will raise AttributeError if class cannot be found
    c = getattr(m, class_name)
    return c


def get_field_or_none(model, field_name):
    try:
        return model._meta.get_field(field_name)
    except FieldDoesNotExist:
        return None


def get_method_or_none(model, name):
    try:
        return get_class_method(model, name)

# Path: pyston/utils/compatibility.py
# def get_field_or_none(model, field_name):
# def get_all_related_objects_from_model(model):
# def get_concrete_field(model, field_name):
# def is_reverse_many_to_one(model, field_name):
# def is_reverse_one_to_one(model, field_name):
# def is_reverse_many_to_many(model, field_name):
# def is_many_to_one(model, field_name):
# def is_one_to_one(model, field_name):
# def is_many_to_many(model, field_name):
# def is_relation(model, field_name):
# def get_model_from_relation(model, field_name):
# def get_model_from_relation_or_none(model, field_name):
# def get_reverse_field_name(model, field_name):
# def get_last_parent_pk_field_name(obj):
# def delete_cached_value(instance, field_name):


# Path: pyston/utils/helpers.py
import types
import sys
import datetime
import decimal
import uuid
from io import BytesIO
from django.utils.encoding import force_bytes
from django.conf import settings
from django.utils.duration import duration_iso_string
from django.utils.functional import Promise
from django.utils.timezone import is_aware
from chamber.utils import get_class_method
from .compatibility import FieldDoesNotExist
    from pyston.serializer import LAZY_SERIALIZERS

        if data.microsecond:
            r = r[:12]
        return r
    elif isinstance(data, datetime.timedelta):
        return duration_iso_string(data)
    elif isinstance(data, (decimal.Decimal, uuid.UUID, Promise)):
        return str(data)
    else:
        return data


def str_to_class(class_string):
    module_name, class_name = class_string.rsplit('.', 1)
    # load the module, will raise ImportError if module cannot be loaded
    m = __import__(module_name, globals(), locals(), str(class_name))
    # get the class, will raise AttributeError if class cannot be found
    c = getattr(m, class_name)
    return c


def get_field_or_none(model, field_name):
    try:
        return model._meta.get_field(field_name)
    except FieldDoesNotExist:
        return None


def get_method_or_none(model, name):
    try:
        return get_class_method(model, name)

    except (AttributeError, FieldDoesNotExist):