diff --git a/src/protean/impl/repository/dict_repo.py b/src/protean/impl/repository/dict_repo.py
index a2eaac7f..7f8f01ce 100644
--- a/src/protean/impl/repository/dict_repo.py
+++ b/src/protean/impl/repository/dict_repo.py
@@ -329,19 +329,23 @@ class DefaultDictLookup(BaseLookup):
     def process_source(self):
         """Return source with transformations, if any"""
         if isinstance(self.source, str):
-            return "'%s'" % self.source
+            # Replace single and double quotes with escaped single-quote
+            self.source = self.source.replace("'", "\'").replace('"', "\'")
+            return "\"{source}\"".format(source=self.source)
         return self.source
 
     def process_target(self):
         """Return target with transformations, if any"""
         if isinstance(self.target, str):
-            return "'%s'" % self.target
+            # Replace single and double quotes with escaped single-quote
+            self.target = self.target.replace("'", "\'").replace('"', "\'")
+            return "\"{target}\"".format(target=self.target)
         return self.target
 
     def as_expression(self):
-        return '%s %s %s' % (self.process_source(),
-                             operators[self.lookup_name],
-                             self.process_target())
+        return '{source} {op} {target}'.format(source=self.process_source(),
+                                               op=operators[self.lookup_name],
+                                               target=self.process_target())
 
 
 @DictProvider.register_lookup

Handle escaped quotes in values
`Dog.create(id=4, name='d\'Artagnan', owner='John', age=5)`

results in:
```
src/protean/core/entity.py:691: in create
    entity._validate_unique()
src/protean/core/entity.py:804: in _validate_unique
    if self.exists(excludes, **{filter_key: lookup_value}):
src/protean/core/entity.py:669: in exists
    return bool(results)
src/protean/core/entity.py:331: in __bool__
    return bool(self.all())
src/protean/core/entity.py:293: in all
    results = adapter._filter_objects(self._criteria, self._page, self._per_page, order_by)
src/protean/impl/repository/dict_repo.py:104: in _filter_objects
    items = list(self._filter(criteria, self.conn['data'][self.model_name]).values())
src/protean/impl/repository/dict_repo.py:84: in _filter
    input_db = self._evaluate_lookup(child[0], child[1], negated, input_db)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <protean.impl.repository.dict_repo.Adapter object at 0x10572bb70>, key = 'name', value = "d'Artagnan", negated = False
db = {1: {'age': 2, 'id': 1, 'name': 'Athos', 'owner': 'John'}, 2: {'age': 3, 'id': 2, 'name': 'Porthos', 'owner': 'John'}, 3: {'age': 4, 'id': 3, 'name': 'Aramis', 'owner': 'John'}}

    def _evaluate_lookup(self, key, value, negated, db):
        """Extract values from DB that match the given criteria"""
        results = {}
        for record_key, record_value in db.items():
            match = True
    
            stripped_key, lookup_class = self._extract_lookup(key)
            lookup = lookup_class(record_value[stripped_key], value)
    
            if negated:
                match &= not eval(lookup.as_expression())
            else:
>               match &= eval(lookup.as_expression())
E                 File "<string>", line 1
E                   'Athos' == 'd'Artagnan'
E                                        ^
E               SyntaxError: invalid syntax

src/protean/impl/repository/dict_repo.py:63: SyntaxError
```

diff --git a/tests/core/test_entity.py b/tests/core/test_entity.py
index 8dc00c60..00f5fd25 100644
--- a/tests/core/test_entity.py
+++ b/tests/core/test_entity.py
@@ -276,7 +276,7 @@ class TestEntity:
         Dog.create(id=1, name='Athos', owner='John', age=2)
         Dog.create(id=2, name='Porthos', owner='John', age=3)
         Dog.create(id=3, name='Aramis', owner='John', age=4)
-        Dog.create(id=4, name='dArtagnan', owner='John', age=5)
+        Dog.create(id=4, name='d\'Artagnan', owner='John', age=5)
 
         # Perform update
         updated_count = Dog.query.filter(age__gt=3).update(owner='Jane')
@@ -298,7 +298,7 @@ class TestEntity:
         Dog.create(id=1, name='Athos', owner='John', age=2)
         Dog.create(id=2, name='Porthos', owner='John', age=3)
         Dog.create(id=3, name='Aramis', owner='John', age=4)
-        Dog.create(id=4, name='dArtagnan', owner='John', age=5)
+        Dog.create(id=4, name='d\'Artagnan', owner='John', age=5)
 
         # Perform update
         updated_count = Dog.query.filter(age__gt=3).update_all({'owner': 'Jane'})
@@ -320,7 +320,7 @@ class TestEntity:
         Dog.create(id=1, name='Athos', owner='John', age=2)
         Dog.create(id=2, name='Porthos', owner='John', age=3)
         Dog.create(id=3, name='Aramis', owner='John', age=4)
-        Dog.create(id=4, name='dArtagnan', owner='John', age=5)
+        Dog.create(id=4, name='d\'Artagnan', owner='John', age=5)
 
         # Perform update
         updated_count = Dog.query.filter(age__gt=3).update_all(owner='Jane')
@@ -559,7 +559,7 @@ class TestEntity:
         Dog.create(id=1, name='Athos', owner='John', age=2)
         Dog.create(id=2, name='Porthos', owner='John', age=3)
         Dog.create(id=3, name='Aramis', owner='John', age=4)
-        Dog.create(id=4, name='dArtagnan', owner='John', age=5)
+        Dog.create(id=4, name='d\'Artagnan', owner='John', age=5)
 
         dogs = Dog.query.all()
         assert dogs.total == 4
@@ -574,7 +574,7 @@ class TestEntity:
         Dog.create(id=1, name='Athos', owner='John', age=2)
         Dog.create(id=2, name='Porthos', owner='John', age=3)
         Dog.create(id=3, name='Aramis', owner='John', age=4)
-        Dog.create(id=4, name='dArtagnan', owner='John', age=5)
+        Dog.create(id=4, name='d\'Artagnan', owner='John', age=5)
 
         # Perform update
         deleted_count = Dog.query.filter(age__gt=3).delete_all()
@@ -599,7 +599,7 @@ class TestEntity:
         Dog.create(id=1, name='Athos', owner='John', age=2)
         Dog.create(id=2, name='Porthos', owner='John', age=3)
         Dog.create(id=3, name='Aramis', owner='John', age=4)
-        Dog.create(id=4, name='dArtagnan', owner='John', age=5)
+        Dog.create(id=4, name='d\'Artagnan', owner='John', age=5)
 
         # Perform update
         deleted_count = Dog.query.filter(age__gt=3).delete()
@@ -627,6 +627,20 @@ class TestEntity:
         query = Dog.query.filter(owner='John')
         assert isinstance(query, QuerySet)
 
+    def test_escaped_quotes_in_values(self):
+        """Test that escaped quotes in values are handled properly"""
+
+        Dog.create(name='Athos', owner='John', age=2)
+        Dog.create(name='Porthos', owner='John', age=3)
+        Dog.create(name='Aramis', owner='John', age=4)
+
+        dog1 = Dog.create(name="d'Artagnan1", owner='John', age=5)
+        dog2 = Dog.create(name="d\'Artagnan2", owner='John', age=5)
+        dog3 = Dog.create(name="d\"Artagnan3", owner='John', age=5)
+        dog4 = Dog.create(name='d\"Artagnan4', owner='John', age=5)
+
+        assert all(dog is not None for dog in [dog1, dog2, dog3, dog4])
+    
     def test_override(self):
         """Test overriding methods from Entity"""
         class ImmortalDog(Entity):

pip install -e .[dev]
parse_log_pytest
requirements.txt
pytest pytest-cov pytest-xdist pytest-mock pytest-asyncio
apt-get update apt-get install -y gcc
3.7
requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
alabaster==0.7.13
Babel==2.14.0
certifi @ file:///croot/certifi_1671487769961/work/certifi
charset-normalizer==3.4.1
check-manifest==0.37
Click==7.0
coverage==7.2.7
distlib==0.3.9
docutils==0.14
exceptiongroup==1.2.2
execnet==2.0.2
filelock==3.12.2
flake8==5.0.4
idna==3.10
imagesize==1.4.1
importlib-metadata==4.2.0
iniconfig==2.0.0
Jinja2==3.1.6
MarkupSafe==2.1.5
mccabe==0.7.0
packaging==24.0
pkginfo==1.10.0
platformdirs==2.6.2
pluggy==0.13.1
-e git+https://github.com/proteanhq/protean.git@abc8cc566db963c676543d4792cea7b68c024a53#egg=protean
py==1.11.0
pycodestyle==2.9.1
pyflakes==2.5.0
Pygments==2.17.2
pytest==7.4.4
pytest-asyncio==0.21.2
pytest-cov==4.1.0
pytest-flake8==1.0.4
pytest-mock==3.11.1
pytest-xdist==3.5.0
python-dateutil==2.7.3
pytz==2025.2
requests==2.31.0
requests-toolbelt==1.0.0
six==1.17.0
snowballstemmer==2.2.0
Sphinx==1.8.3
sphinxcontrib-serializinghtml==1.1.5
sphinxcontrib-websupport==1.2.4
tomli==2.0.1
tox==3.1.2
tqdm==4.67.1
twine==1.11.0
typing_extensions==4.7.1
urllib3==2.0.7
virtualenv==20.16.2
zipp==3.15.0

name: protean
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2022.12.7=py37h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=22.3.1=py37h06a4308_0
  - python=3.7.16=h7a1cb2a_0
  - readline=8.2=h5eee18b_0
  - setuptools=65.6.3=py37h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.38.4=py37h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - alabaster==0.7.13
      - babel==2.14.0
      - charset-normalizer==3.4.1
      - check-manifest==0.37
      - click==7.0
      - coverage==7.2.7
      - distlib==0.3.9
      - docutils==0.14
      - exceptiongroup==1.2.2
      - execnet==2.0.2
      - filelock==3.12.2
      - flake8==5.0.4
      - idna==3.10
      - imagesize==1.4.1
      - importlib-metadata==4.2.0
      - iniconfig==2.0.0
      - jinja2==3.1.6
      - markupsafe==2.1.5
      - mccabe==0.7.0
      - packaging==24.0
      - pkginfo==1.10.0
      - platformdirs==2.6.2
      - pluggy==0.13.1
      - py==1.11.0
      - pycodestyle==2.9.1
      - pyflakes==2.5.0
      - pygments==2.17.2
      - pytest==7.4.4
      - pytest-asyncio==0.21.2
      - pytest-cov==4.1.0
      - pytest-flake8==1.0.4
      - pytest-mock==3.11.1
      - pytest-xdist==3.5.0
      - python-dateutil==2.7.3
      - pytz==2025.2
      - requests==2.31.0
      - requests-toolbelt==1.0.0
      - six==1.17.0
      - snowballstemmer==2.2.0
      - sphinx==1.8.3
      - sphinxcontrib-serializinghtml==1.1.5
      - sphinxcontrib-websupport==1.2.4
      - tomli==2.0.1
      - tox==3.1.2
      - tqdm==4.67.1
      - twine==1.11.0
      - typing-extensions==4.7.1
      - urllib3==2.0.7
      - virtualenv==20.16.2
      - zipp==3.15.0
prefix: /opt/conda/envs/protean

tests/core/test_entity.py::TestEntity::test_update_by tests/core/test_entity.py::TestEntity::test_update_all_with_args tests/core/test_entity.py::TestEntity::test_update_all_with_kwargs tests/core/test_entity.py::TestEntity::test_delete_all tests/core/test_entity.py::TestEntity::test_delete_all_by_filter tests/core/test_entity.py::TestEntity::test_delete_by tests/core/test_entity.py::TestEntity::test_escaped_quotes_in_values
tests/core/test_entity.py::TestEntity::test_init tests/core/test_entity.py::TestEntity::test_individuality tests/core/test_entity.py::TestEntity::test_required_fields tests/core/test_entity.py::TestEntity::test_defaults tests/core/test_entity.py::TestEntity::test_validate_string_length tests/core/test_entity.py::TestEntity::test_validate_data_value_against_type tests/core/test_entity.py::TestEntity::test_template_init tests/core/test_entity.py::TestEntity::test_error_messages tests/core/test_entity.py::TestEntity::test_entity_inheritance tests/core/test_entity.py::TestEntity::test_default_id tests/core/test_entity.py::TestEntity::test_to_dict tests/core/test_entity.py::TestEntity::test_get tests/core/test_entity.py::TestEntity::test_get_object_not_found_error tests/core/test_entity.py::TestEntity::test_find_by tests/core/test_entity.py::TestEntity::test_find_by_object_not_found_error tests/core/test_entity.py::TestEntity::test_find_by_multiple_attributes tests/core/test_entity.py::TestEntity::test_find_by_multiple_attributes_object_not_found_error tests/core/test_entity.py::TestEntity::test_create_error tests/core/test_entity.py::TestEntity::test_create tests/core/test_entity.py::TestEntity::test_save tests/core/test_entity.py::TestEntity::test_save_validation_error tests/core/test_entity.py::TestEntity::test_save_invalid_value tests/core/test_entity.py::TestEntity::test_update_with_invalid_id tests/core/test_entity.py::TestEntity::test_update_with_dict tests/core/test_entity.py::TestEntity::test_update_with_kwargs tests/core/test_entity.py::TestEntity::test_update_with_dict_and_kwargs tests/core/test_entity.py::TestEntity::test_that_update_runs_validations tests/core/test_entity.py::TestEntity::test_unique tests/core/test_entity.py::TestEntity::test_query_init tests/core/test_entity.py::TestEntity::test_filter_chain_initialization_from_entity tests/core/test_entity.py::TestEntity::test_filter_chaining tests/core/test_entity.py::TestEntity::test_filter_chain_results_1 tests/core/test_entity.py::TestEntity::test_filter_chain_results_2 tests/core/test_entity.py::TestEntity::test_filter_chain_results_3 tests/core/test_entity.py::TestEntity::test_filter_norm tests/core/test_entity.py::TestEntity::test_exclude tests/core/test_entity.py::TestEntity::test_exclude_multiple tests/core/test_entity.py::TestEntity::test_comparisons tests/core/test_entity.py::TestEntity::test_invalid_comparison_on_query_evaluation tests/core/test_entity.py::TestEntity::test_pagination tests/core/test_entity.py::TestEntity::test_delete tests/core/test_entity.py::TestEntity::test_filter_returns_q_object tests/core/test_entity.py::TestEntity::test_override tests/core/test_entity.py::TestEntityMetaAttributes::test_entity_structure tests/core/test_entity.py::TestEntityMetaAttributes::test_meta_overriding_abstract tests/core/test_entity.py::TestEntityMetaAttributes::test_meta_overriding_schema_name tests/core/test_entity.py::TestEntityMetaAttributes::test_meta_overriding_provider tests/core/test_entity.py::TestEntityMetaAttributes::test_meta_overriding_order_by tests/core/test_entity.py::TestEntityMetaAttributes::test_meta_on_init tests/core/test_entity.py::TestEntityMetaAttributes::test_declared_fields_normal tests/core/test_entity.py::TestEntityMetaAttributes::test_declared_fields_with_reference tests/core/test_entity.py::TestEntityMetaAttributes::test_declared_fields_with_hasone_association
src/protean/impl/repository/dict_repo.py
src/protean/impl/repository/dict_repo.py