# Path: rest/model_tools.py
# def get_object_id(instance):
#     ct = get_ct(instance)
#     config = ct.get_config()
#     if config and 'lookup' in config:
#         return getattr(instance, config['lookup'])
#     return instance.pk
# 
# Path: rest/exceptions.py
# class ImproperlyConfigured(ImproperlyConfigured):
#     pass


from rest_framework import serializers
from django.core.exceptions import ImproperlyConfigured
    from django.contrib.gis.db import models as model_fields
    from django.contrib.gis.geos import GEOSGeometry
    from django.db import models as model_fields
from django.utils import timezone
from django.core.exceptions import FieldDoesNotExist
from collections import OrderedDict
from django.conf import settings
from rest_framework.utils import model_meta
from html_json_forms.serializers import JSONFormSerializer
from .model_tools import get_object_id
from .exceptions import ImproperlyConfigured
        import json
        import json
            import pystache
try:
except (OSError, ImproperlyConfigured):
    GEOSGeometry = None






# Path: rest/model_tools.py
# def get_object_id(instance):
#     ct = get_ct(instance)
#     config = ct.get_config()
#     if config and 'lookup' in config:
#         return getattr(instance, config['lookup'])
#     return instance.pk
# 
# Path: rest/exceptions.py
# class ImproperlyConfigured(ImproperlyConfigured):
#     pass


# Path: rest/serializers.py
from rest_framework import serializers
from django.core.exceptions import ImproperlyConfigured
    from django.contrib.gis.db import models as model_fields
    from django.contrib.gis.geos import GEOSGeometry
    from django.db import models as model_fields
from django.utils import timezone
from django.core.exceptions import FieldDoesNotExist
from collections import OrderedDict
from django.conf import settings
from rest_framework.utils import model_meta
from html_json_forms.serializers import JSONFormSerializer
from .model_tools import get_object_id
from .exceptions import ImproperlyConfigured
        import json
        import json
            import pystache

try:
except (OSError, ImproperlyConfigured):
    GEOSGeometry = None






class GeometryField(serializers.Field):