Skip to content
Snippets Groups Projects
Select Git revision
  • a3e87f5fe1ee3628ca2bdd67509605ce518158b6
  • master default protected
  • renovate/configure
  • 1.0.post2
  • 1.0.post1
  • 1.0
6 results

django-starfield

  • Clone with SSH
  • Clone with HTTPS
  • Dominik George's avatar
    Nik | Klampfradler authored
    a3e87f5f
    History

    Django stars widget

    Description

    This is a simple widget rendering so-called rating stars as input for an integer field. It is based solely on CSS 3, as laid out by Martin Ivanov.

    Usage

    Just add the Stars widget to any IntegerField in a Django form.

    from django import forms
    from django_starfield import Stars
    
    class StarsExampleForm(forms.Form):
        rating = forms.IntegerField(widget=Stars())

    You can change the number of stars by passing the stars argument to the Stars widget.

    Differences

    This is different from other star rating applications in that it provides only a widget returning its selction to any IntegerField. It is not a complete rating application, just a presentational widget for integer input. It is also different in that it depends only on CSS3, without any JavaScript.