defrex / django-encrypted-fields

This is a collection of Django Model Field classes that are encrypted using Keyczar.
MIT License
193 stars 60 forks source link

`get_internal_type` for EncryptedIntegerField (django 1.7) #7

Closed coldmind closed 9 years ago

coldmind commented 9 years ago

Why get_internal_type is also TextField for EncryptedIntegerField? When it cames to django validation, django.db.backends.BaseDatabaseOperations#integer_field_range fails, because there are no TextField in self.integer_field_ranges.

I got this problem in django 1.7.

UPD: I understood why, because after encryption it became text. But before it will be saved in DB, it must pass validation.

defrex commented 9 years ago

The test suite includes a test of EncryptedIntegerField that passes fine under Django 1.7. Can you provide an example of what you are trying to do, and a full traceback of the resulting error?

coldmind commented 9 years ago

Issue exists at least for postgresql (maybe mysql and etc. are affected), where self.integer_field_ranges are defined. I created project with minimum steps to reproduce: https://github.com/coldmind/django-encrypted-fields_issue7

Problem is in full_clean of django1.7 When I installed 1.6, full_clean passes without exception.