Skip to content

Commit

Permalink
Tighten up the model example and add a warning about querying against…
Browse files Browse the repository at this point in the history
… encrypted data.
  • Loading branch information
defrex committed Jul 12, 2013
1 parent 4fc9d15 commit 99d24c8
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,14 @@ In your `settings.py`

Then, in `models.py`

from encrypted_fields import (
EncryptedCharField,
EncryptedTextField,
EncryptedDateTimeField,
EncryptedIntegerField,
)
from encrypted_fields import EncryptedTextField

class MyModel(models.Model):
char_field = EncryptedCharField(max_length=255)
text_field = EncryptedTextField()
datetime_field = EncryptedDateTimeField()
integer_field = EncryptedIntegerField()

Use your model as normal and your data will be encrypted in the database.

_Warning:_ Once the data is encrypted, it can no longer to used to query or sort. In SQL, these will all look like text fields with random noise in them (which is what you want).

#### Available Fields

Expand Down

0 comments on commit 99d24c8

Please sign in to comment.