Created
December 2, 2016 18:56
-
-
Save AstraLuma/b0f64b0f6b5a0d5152eece0e0e776e84 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from django import forms | |
| from localflavor.us.forms import USPSSelect | |
| class NoDefaultSelect(forms.Select): | |
| def render_options(self, selected_choices): | |
| opts = super().render_options(selected_choices) | |
| if selected_choices: | |
| opts = "<option disabled selected value style='display:none;'></option>\n" + opts | |
| return opts | |
| class NoDefaultUSPSSelect(USPSSelect, NoDefaultSelect): | |
| pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment