This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!

cust renderer

By: a guest on Dec 28th, 2011  |  syntax: Python  |  size: 0.29 KB  |  views: 37  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. class HorizRadioRenderer(forms.RadioSelect.renderer):
  2.     """ this overrides widget method to put radio buttons horizontally
  3.        instead of vertically.
  4.    """
  5.     def render(self):
  6.             """Outputs radios"""
  7.             return mark_safe(u'\n'.join([u'%s\n' % w for w in self]))
clone this paste RAW Paste Data