Comments (5)
Please, provide a patch with unittest.
from django-fields.
I didn't manage to pass django_fields tests. Output from manage.py test django_fields:
ERROR: test_date_encryption (example.django_fields.tests.DateEncryptTests)
Traceback (most recent call last):
File "/home/srk/Devel/git/django-fields/src/example/../example/django_fields/tests.py", line 149, in test_date_encryption
obj.save()
File "/usr/local/lib/python2.7/dist-packages/django/db/models/base.py", line 460, in save
self.save_base(using=using, force_insert=force_insert, force_update=force_update)
File "/usr/local/lib/python2.7/dist-packages/django/db/models/base.py", line 543, in save_base
for f in meta.local_fields if not isinstance(f, AutoField)]
File "/usr/local/lib/python2.7/dist-packages/django/db/models/fields/subclassing.py", line 28, in inner
return func(_args, *_kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/db/models/fields/subclassing.py", line 28, in inner
return func(_args, *_kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/db/models/fields/subclassing.py", line 28, in inner
return func(_args, *_kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/db/models/fields/subclassing.py", line 28, in inner
return func(_args, *_kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/db/models/fields/init.py", line 276, in get_db_prep_save
return self.get_db_prep_value(value, connection=connection, prepared=False)
File "/usr/local/lib/python2.7/dist-packages/django/db/models/fields/subclassing.py", line 53, in inner
return func(_args, *_kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/db/models/fields/subclassing.py", line 53, in inner
return func(_args, *_kwargs)
File "/home/srk/Devel/git/django-fields/src/example/django_fields/fields.py", line 153, in get_db_prep_value
return super(BaseEncryptedDateField, self).get_db_prep_value(date_text, connection, prepared)
File "/usr/local/lib/python2.7/dist-packages/django/db/models/fields/subclassing.py", line 53, in inner
return func(_args, *_kwargs)
TypeError: get_db_prep_value() got multiple values for keyword argument 'connection'
ERROR: test_date_time_encryption (example.django_fields.tests.DateEncryptTests)
Traceback (most recent call last):
File "/home/srk/Devel/git/django-fields/src/example/../example/django_fields/tests.py", line 161, in test_date_time_encryption
obj.save()
File "/usr/local/lib/python2.7/dist-packages/django/db/models/base.py", line 460, in save
self.save_base(using=using, force_insert=force_insert, force_update=force_update)
File "/usr/local/lib/python2.7/dist-packages/django/db/models/base.py", line 543, in save_base
for f in meta.local_fields if not isinstance(f, AutoField)]
File "/usr/local/lib/python2.7/dist-packages/django/db/models/fields/subclassing.py", line 28, in inner
return func(_args, *_kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/db/models/fields/subclassing.py", line 28, in inner
return func(_args, *_kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/db/models/fields/subclassing.py", line 28, in inner
return func(_args, *_kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/db/models/fields/subclassing.py", line 28, in inner
return func(_args, *_kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/db/models/fields/init.py", line 276, in get_db_prep_save
return self.get_db_prep_value(value, connection=connection, prepared=False)
File "/usr/local/lib/python2.7/dist-packages/django/db/models/fields/subclassing.py", line 53, in inner
return func(_args, *_kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/db/models/fields/subclassing.py", line 53, in inner
return func(_args, *_kwargs)
File "/home/srk/Devel/git/django-fields/src/example/django_fields/fields.py", line 153, in get_db_prep_value
return super(BaseEncryptedDateField, self).get_db_prep_value(date_text, connection, prepared)
File "/usr/local/lib/python2.7/dist-packages/django/db/models/fields/subclassing.py", line 53, in inner
return func(_args, *_kwargs)
TypeError: get_db_prep_value() got multiple values for keyword argument 'connection'
Ran 22 tests in 0.122s
I use Django 1.3.1
from django-fields.
The problem was in my code
from django-fields.
Hi.
@DXist why did you reopened this issue?
from django-fields.
Hi! I figured out that south introspects wrong value for max_length (see #20). It should honour initial max_length value (maximum length of unencrypted data) that is saved in unencrypted_length field attribute. The resulting max_length value is changed to hold encrypted data with padding so it shouldn't be introspected.
The pull request contains an introspection rule to fix this problem for EncryptedCharField and subclasses.
from django-fields.
Related Issues (20)
- EncryptedCharField isn't decrypted in .values() HOT 1
- EncryptedCharField doesn't validate length HOT 1
- Encrypted fields cannot be searched in the admin HOT 8
- global name 'EncryptedPhoneNumberField' is not defined
- EncryptedCharField not encrypting value HOT 2
- Encryption password stored in a cleartext HOT 3
- Insecure block cipher mode HOT 5
- For consideration: Fields automatically decrypted in admin optional. HOT 1
- Use PKCS7 padding.
- Heroku and block_type='MODE_CBC' causes errors HOT 5
- EncryptedDateTimeField Causes "can't compare offset-naive and offset-aware datetimes" Error
- Filtering not supported? HOT 7
- Update Path for MODE_CBC deprecation warning
- Any plans for python3 or Django1.8 support? HOT 3
- Deprecation warning with django 1.3b4 HOT 2
- django 1.10 HOT 13
- Initial Update
- EncryptedDateField Still Broken
- Fix ReadMe so that people know what version of Django it works with
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-fields.