alepane21 / django-nullablecharfield Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Hello!
Thanks for you field :)
But I've got error when saving field with non-ascii value :
/home/asdef/.virtualenvs/autotesting/local/lib/python2.7/site-packages/django/forms/fields.py:142: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
if value in self.empty_values and self.required:
/home/asdef/.virtualenvs/autotesting/local/lib/python2.7/site-packages/django/forms/fields.py:146: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
if value in self.empty_values:
/home/asdef/.virtualenvs/autotesting/local/lib/python2.7/site-packages/django/db/models/base.py:1153: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
if f.blank and raw_value in f.empty_values:
/home/asdef/.virtualenvs/autotesting/local/lib/python2.7/site-packages/django/db/models/fields/__init__.py:546: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
if value in self.empty_values:
/home/asdef/.virtualenvs/autotesting/local/lib/python2.7/site-packages/django/forms/fields.py:206: UnicodeWarning: Unicode unequal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
return initial_value != data_value
Internal Server Error: /admin/ankets/address/2/change/
Traceback (most recent call last):
File "/home/asdef/.virtualenvs/autotesting/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 149, in get_response
response = self.process_exception_by_middleware(e, request)
File "/home/asdef/.virtualenvs/autotesting/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 147, in get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/asdef/.virtualenvs/autotesting/local/lib/python2.7/site-packages/django/contrib/admin/options.py", line 541, in wrapper
return self.admin_site.admin_view(view)(*args, **kwargs)
File "/home/asdef/.virtualenvs/autotesting/local/lib/python2.7/site-packages/django/utils/decorators.py", line 149, in _wrapped_view
response = view_func(request, *args, **kwargs)
File "/home/asdef/.virtualenvs/autotesting/local/lib/python2.7/site-packages/django/views/decorators/cache.py", line 57, in _wrapped_view_func
response = view_func(request, *args, **kwargs)
File "/home/asdef/.virtualenvs/autotesting/local/lib/python2.7/site-packages/django/contrib/admin/sites.py", line 244, in inner
return view(request, *args, **kwargs)
File "/home/asdef/.virtualenvs/autotesting/local/lib/python2.7/site-packages/django/contrib/admin/options.py", line 1438, in change_view
return self.changeform_view(request, object_id, form_url, extra_context)
File "/home/asdef/.virtualenvs/autotesting/local/lib/python2.7/site-packages/django/utils/decorators.py", line 67, in _wrapper
return bound_func(*args, **kwargs)
File "/home/asdef/.virtualenvs/autotesting/local/lib/python2.7/site-packages/django/utils/decorators.py", line 149, in _wrapped_view
response = view_func(request, *args, **kwargs)
File "/home/asdef/.virtualenvs/autotesting/local/lib/python2.7/site-packages/django/utils/decorators.py", line 63, in bound_func
return func.__get__(self, type(self))(*args2, **kwargs2)
File "/home/asdef/.virtualenvs/autotesting/local/lib/python2.7/site-packages/django/utils/decorators.py", line 184, in inner
return func(*args, **kwargs)
File "/home/asdef/.virtualenvs/autotesting/local/lib/python2.7/site-packages/django/contrib/admin/options.py", line 1385, in changeform_view
self.log_change(request, new_object, change_message)
File "/home/asdef/.virtualenvs/autotesting/local/lib/python2.7/site-packages/django/contrib/admin/options.py", line 730, in log_change
object_repr=force_text(object),
File "/home/asdef/.virtualenvs/autotesting/local/lib/python2.7/site-packages/django/utils/encoding.py", line 88, in force_text
raise DjangoUnicodeDecodeError(s, *e.args)
DjangoUnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 0: ordinal not in range(128). You passed in <Address: [Bad Unicode data]> (<class 'ankets.models.Address'>)
My resolve: in file nullablecharfield/forms/fields.py
I chage line 19 from
return smart_str(value)
to
return value
! South cannot introspect some fields; this is probably because they are custom
! fields. If they worked in 0.6 or below, this is because we have removed the
! models parser (it often broke things).
! To fix this, read http://south.aeracode.org/wiki/MyFieldsDontWork
...I'll work on a PR for this.
This looks useful! Would you be willing to upload a release to PyPI?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.