I'm making a framework to improve the development of an existing system. My main task was to make said system responsive, and we settled in using material design. we're using django version 1.9.
We've tried a lot of existing frameworks (django material, grappelli, etc), but we decided to develop our own, because if we were to use an existing framework we'd have to hack the sh*t out of it, basically.
The thing is, right now I need to be able to render HTML widgets so that materialize (the library we're using) displays them nicely. I know that, as far as what I've read (pretty much anywhere), this is not possible by default. So I've come up with two ways to do so (I implemented a quick and dirty version of the second and it works, kind of), but I find both of them to be extremely... not elegant.
The first one consists on creating our own database fields, inheriting from the ones defined in django, overwriting the formfield method to use custom form fields (which we would create by inheriting from django's ones and making them use our custom widgets). I (clearly) haven't implemented this one because it seems to involve too much overwriting to my taste.
The second option that I've come up with is creating a custom template tag (called something like render_form), that takes a form, iterates over its fields, and uses custom templates to render them in a materialize-friendly way. I did implement a fairly elemental version of this option (although I don't have the code at hand), and it worked; but it doesn't feels elegant (nor efficient) enough.
Which one of the two would be better to implement? (If you can also tell me why you think that option is the correct one, that would be awesome). Also, is there any other way to do this that I'm missing?