On Tue, Feb 10, 2009 at 7:10 PM, Alex Gaynor <[email protected]> wrote:
> > > On Tue, Feb 10, 2009 at 7:06 PM, Brian Rosner <[email protected]> wrote: > >> >> Hey all, >> >> I recently came across the issue described in #5903 [1] earlier. There >> are two distinct patches that fix the problem, but at different >> levels. My inclination is to fix this issue at the model field level >> and properly override get_default. My feeling is that allowing Decimal >> objects to pass through force_unicode (when strings_only=True) might >> cause ill-effects in other parts of Django, but I am not entirely sure >> (running the test suite with the fix in force_unicode didn't cause any >> failed test, but that doesn't make it right to me :). I don't see much >> reason to do so. Perhaps someone can shed some light on this? >> >> [1]: http://code.djangoproject.com/ticket/5903 >> >> -- >> Brian Rosner >> http://oebfare.com >> >> >> >> > It seems force_unicode is the wrong level to fix this at, and doing it in > get_default() is the right place. > > Alex > > -- > "I disapprove of what you say, but I will defend to the death your right to > say it." --Voltaire > "The people's good is the highest law."--Cicero > I sent that last email off rather hastily, and didn't think about it enough, and of course I've changed my mind :). It seems to me this is the exact purpose of the strings_only kwarg, for when what we want to do is make sure a string becomes unicode, but not to mess with other objects. Further it's clearly how other fields(integer, date, etc.) do it, so that further the argument that that is the correct way to handle it/use strings_only. Alex -- "I disapprove of what you say, but I will defend to the death your right to say it." --Voltaire "The people's good is the highest law."--Cicero --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/django-developers?hl=en -~----------~----~----~----~------~----~------~--~---
