Skip to content

Instantly share code, notes, and snippets.

@graingert
Created April 4, 2012 17:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save graingert/2304275 to your computer and use it in GitHub Desktop.
Save graingert/2304275 to your computer and use it in GitHub Desktop.
from django.forms import ModelForm, HiddenInput, MultipleHiddenInput, Textarea
from models import Thing, Review, UserProfile
from rays.widgets import RangeInput
class ReviewForm(ModelForm):
mentioned = Textarea()
class Meta:
model = Review
exclude = ("author",)
widgets = {
'rating': RangeInput(min_value=-3, max_value=3, step=2), #uses 4 states preventing any "on the fence choices"
'reviewed_uri' : HiddenInput(),
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment