Skip to content

Commit 70764cd

Browse files
committed
Update docs
Unfortunately I think we'll need to explain this by example. I'm tempted to use `mongosh` but probably best to stick to Python.
1 parent 2c1b9ea commit 70764cd

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

docs/topics/queryable-encryption.rst

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -62,25 +62,29 @@ create and manipulate instances of the data just like any other Django model
6262
data. The fields will automatically handle encryption and decryption, ensuring
6363
that sensitive data is stored securely in the database.
6464

65-
From an encrypted client, enter the secure data::
65+
.. TODO
66+
67+
.. code-block:: console
6668
69+
$ python manage.py shell
6770
>>> from myapp.models import Patient, PatientRecord, Billing
6871
>>> billing = Billing(cc_type="Visa", cc_number="4111111111111111")
69-
>>> patient_record = PatientRecord(ssn="123-45-6789", billing=self.billing)
72+
>>> patient_record = PatientRecord(ssn="123-45-6789", billing=billing)
7073
>>> patient = Patient.objects.create(
7174
patient_name="John Doe",
7275
patient_id=123456789,
73-
patient_record=self.patient_record,
76+
patient_record=patient_record,
7477
)
7578
76-
From an unencrypted client, you can still access the data, but the sensitive
77-
fields will be encrypted. For example, if you try to access the ``ssn`` field
78-
from an unencrypted client, you will see the encrypted value::
79+
.. code-block:: console
7980
80-
from myapp.models import Patient
81+
>>> john = Patient.objects.get(name="John Doe")
82+
>>> john.patient_record.ssn
83+
'123-45-6789'
84+
85+
.. code-block:: console
8186
82-
>>> bob = Patient.objects.get(name="Bob")
83-
>>> bob.patient_record.ssn
87+
>>> john.patient_record.ssn
8488
Binary(b'\x0e\x97sv\xecY\x19Jp\x81\xf1\\\x9cz\t1\r\x02...', 6)
8589
8690
Querying encrypted fields

0 commit comments

Comments
 (0)