labeled hidden input with choices

1
2
3
4
5
6
7
class LabeledHiddenInput(HiddenInput):
    def render(self, name, value, attrs=None):

        status  = self.choices.queryset.get(pk = value)
        
        h_input = super(LabeledHiddenInput, self).render( name, value, attrs=None)
        return mark_safe("%s %s"%(status, h_input))

More like this

  1. Dynamically change a form select widget to a hidden widget by epicserve 3 years, 11 months ago
  2. Bootstrap button dropdown widget (replaces forms.Select) by benjaoming 10 months, 3 weeks ago
  3. ReST google-map directive. by mucius 1 month ago
  4. Template tag which gets specific GET variables from the current request by aruseni.magiku 3 years, 3 months ago
  5. Radio widget with labels after inputs by avsd 11 months, 2 weeks ago

Comments

(Forgotten your password?)