Closed robhudson closed 9 years ago
I will take a look this weekend. I'm sorry I can't get it sooner.
I'm not 100% sure the monkeypatch is needed in 1.7, since Django started supporting the __html__
protocol. I need to dig into that. If we don't need it, we don't need to fix the monkeypatch, just document the change.
Updated based on comments.
I can play with zamboni under Django 1.7 and without the monkey patch. I agree, it looks like it isn't needed now that there's this.
Turns out the monkey patching is still needed. I found cases where forms rendered incorrectly without it. I didn't dig much further than that.
Can you post the cases you found? I'll dig more this weekend but I want to understand why the code has to be there.
Sent from my phone, please excuse the occasional typo.
On Tue, Oct 21, 2014 at 7:15 PM, Rob Hudson notifications@github.com wrote:
Turns out the monkey patching is still needed. I found cases where forms rendered incorrectly without it. I didn't dig much further than that.
Reply to this email directly or view it on GitHub: https://github.com/jbalogh/jingo/pull/62#issuecomment-60014159
I simply commented out the monkey patch and loaded a view with a form in zamboni and saw a bunch of unrendered HTML for the form elements. I'd have to look at how SafeData
is used in django to understand better what's going on.
I'm wondering if we can get this merged?
OK, I think I see what's happening: if StrAndUnicode
isn't there, then only the last 3 lines matter because, for some reason, some classes there don't have the __html__
method.
I'm going to merge this as-is but eventually I'd like to not have the extra class with the runtime basis. Python is cray but that's a little far.
r? @jsocol or @davedash ? Pretty please with a :cherries: on top?