# Path: moma_django/exceptions.py
# class MongoQuerySetExeption(Exception):
#     pass


from types import DictType
from .exceptions import MongoQuerySetExeption
from datetime import datetime, date
        elif len(params) == 3:
            meta_field = model._meta.get_field(params[0])
            rel = meta_field.rel
            #this is field that saved as FK in MongoModel so we can filter by this field
            if rel:
                if params[1] == rel.field_name:
                    lookup = params[2]
                else:
                    raise MongoQuerySetExeption('Does not support related objects filtering. Only be related field.')
            elif meta_field._type is DictType:
                lookup = params[2]
                self._dotFieldNotation = True
            else:
                raise MongoQuerySetExeption('No related fields or dict.')
        elif len(params) == 2:
            lookup = params[1]
            if lookup in ('pk', 'id'): #hotfix. should check `rel` attribute of field
                lookup = 'exact'
        else:
            lookup = 'exact'
        return lookup, params

    def getModelField(self, field_name, model):
        if field_name == 'pk':
            field = model._meta.pk
        else:
            field = model._meta.get_field(field_name)
        return field

    def spec(self, model):

# Path: moma_django/exceptions.py
# class MongoQuerySetExeption(Exception):
#     pass


# Path: moma_django/query_utils.py
from types import DictType
from .exceptions import MongoQuerySetExeption
from datetime import datetime, date

        elif len(params) == 3:
            meta_field = model._meta.get_field(params[0])
            rel = meta_field.rel
            #this is field that saved as FK in MongoModel so we can filter by this field
            if rel:
                if params[1] == rel.field_name:
                    lookup = params[2]
                else:
                    raise MongoQuerySetExeption('Does not support related objects filtering. Only be related field.')
            elif meta_field._type is DictType:
                lookup = params[2]
                self._dotFieldNotation = True
            else:
                raise MongoQuerySetExeption('No related fields or dict.')
        elif len(params) == 2:
            lookup = params[1]
            if lookup in ('pk', 'id'): #hotfix. should check `rel` attribute of field
                lookup = 'exact'
        else:
            lookup = 'exact'
        return lookup, params

    def getModelField(self, field_name, model):
        if field_name == 'pk':
            field = model._meta.pk
        else:
            field = model._meta.get_field(field_name)
        return field

    def spec(self, model):

        lookup, params = self._analyze_field_lookups(model)