File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff 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+
263266Now create and manipulate instances of the data just like any other Django
264267model data. The fields will automatically handle encryption and decryption,
265268ensuring 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
You can’t perform that action at this time.
0 commit comments