Custom Model field, to_python() / from_db_value() and unittests...

2015-06-16 Thread Jens Diemer
I try to create a custom model field, that should "Converting values to Python objects" as described in the documentation here: It doesn't work with Python 2.7 and 3.4 with Django 1.7.x and

Re: Custom Model field, to_python() / from_db_value() and unittests...

2015-06-16 Thread Tim Graham
The doc about how to ignore warnings in tests is here: https://docs.djangoproject.com/en/dev/internals/contributing/writing-code/submitting-patches/#deprecating-a-feature Alternatively, you can temporarily remove these lines in runtests.py: warnings.simplefilter("error", RemovedInDjango20Warning

Re: Custom Model field, to_python() / from_db_value() and unittests...

2015-06-17 Thread Jens Diemer
Am 16.06.2015 um 18:43 schrieb Tim Graham: The doc about how to ignore warnings in tests is here: https://docs.djangoproject.com/en/dev/internals/contributing/writing-code/submitting-patches/#deprecating-a-feature Alternatively, you can temporarily remove these lines in runtests.py: warnings.si

Re: Custom Model field, to_python() / from_db_value() and unittests...

2015-06-17 Thread charettes
Hi Jens, I'm not sure I understand what you are trying to achieve but I assume you want to write a third-party field that supports both Django 1.7 and 1.8 without raising deprecating warnings? I suggest you use the following pattern which also accounts for py2/3: import django from django.db i

Re: Custom Model field, to_python() / from_db_value() and unittests...

2015-06-17 Thread Jens Diemer
Am 17.06.2015 um 16:48 schrieb charettes: I suggest you use the following pattern which also accounts for py2/3: ... This is stepping into the django-user@ territory so I suggest we move the discussion over there if the provided example doesn't match your needs but you are really just trying to