Skip to content

Commit 78af9b4

Browse files
committed
Address UAT feedback
1 parent 723a46f commit 78af9b4

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

docs/howto/queryable-encryption.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,11 +260,24 @@ Then run the migrations with:
260260
you change the definition of an encrypted field, for example, to make it
261261
queryable.
262262

263+
Creating encrypted data
264+
=======================
265+
263266
Now create and manipulate instances of the data just like any other Django
264267
model data. The fields will automatically handle encryption and decryption,
265268
ensuring that :ref:`sensitive data is stored securely in the database
266269
<manual:qe-features-encryption-at-rest>`.
267270

271+
Here's an example of creating a new ``Patient`` instance with encrypted fields:
272+
273+
.. code-block:: pycon
274+
275+
>>> from myapp.models import Patient, PatientRecord, Billing
276+
>>> billing = Billing(cc_type="Visa", cc_number="4111111111111111")
277+
>>> record = PatientRecord(ssn="123-45-6789", billing=billing, bill_amount=250.75)
278+
>>> patient = Patient(patient_name="John Doe", patient_id=1001, patient_record=record)
279+
>>> patient.save()
280+
268281
Querying encrypted fields
269282
=========================
270283

0 commit comments

Comments
 (0)