Create controls-row in django-crispy-forms -
using django-crispy-forms want combine 2 (or more) widgets on single row. see attached example. think should possible using library, although documentation include examples on issue , source code didn't help either. has managed similar results using django-crispy-forms?
the html required such form looks this:
<div class="control-group"> <label for="desc" class="control-label"> description </label> <div class="controls controls-row"> <input class="span2" maxlength="255" type="text" id="desc"> <input class="span3" maxlength="255" type="text"> </div> </div>
you defining html object in `def init(self, *args, **kwargs): in layout object. html give freedom want needs.
there way too. create own template in in templates folder , in layout object define path template example:
field('name', template='path/to/template/single_line_input.html'),
where 'name' widget.
of course of study seek playing around in css files app, float: left
or display: inline
might help, have define classes on widgets should displayed inline. bit tricky not skilled in frontend css (for result various in different browsers , on different resolutions, needless testing needed). problem have fact browsers rendering input fields block objects default, take space in 1 line if width less.
django django-forms django-crispy-forms
No comments:
Post a Comment