Skip to content

Instantly share code, notes, and snippets.

@LowerDeez
Created February 26, 2018 14:33
Show Gist options
  • Save LowerDeez/0f0aa59d1d705f98ec47035333270c25 to your computer and use it in GitHub Desktop.
Save LowerDeez/0f0aa59d1d705f98ec47035333270c25 to your computer and use it in GitHub Desktop.
Django. Float Choices
blank_choice = ((None, '---------'),)
STAR_CHOICES = blank_choice + tuple((float(i*0.5), str(float(i*0.5))) for i in range(1, 11))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment