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

ValueError: zero length field name in format #5

Closed ghost closed 10 years ago

ghost commented 10 years ago

Getting error: File "/home/idbill/workspace/OPT/venv/pyvenv/lib/python2.6/site-packages/django/db/models/sql/compiler.py", line 979, in as_sql val = field.get_db_prep_save(val, connection=self.connection) File "/home/idbill/workspace/OPT/venv/pyvenv/lib/python2.6/site-packages/django/db/models/fields/init.py", line 304, in get_db_prep_save prepared=False) File "/home/idbill/workspace/OPT/venv/pyvenv/lib/python2.6/site-packages/encrypted_fields/fields.py", line 194, in get_db_prep_value len(value), ValueError: zero length field name in format

Appears the following: 'Field {} max_length={} encrypted_len={}'.format( self.name, self.max_length, len(value),

needs to be: 'Field {0} max_length={1} encrypted_len={2}'.format( self.name, self.max_length, len(value),

as per: http://stackoverflow.com/questions/20941386/django-manage-py-returns-valueerror-zero-length-field-name-in-format

defrex commented 10 years ago

Ya, {} only works in Python 2.7+.