Created
April 20, 2015 21:16
-
-
Save jrabbit/a6d39e5264fbd166c419 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
class PaperEmailInput(EmailInput): | |
def render(self, name, value, attrs=None): | |
if value is None: | |
html = """<paper-input-decorator label='{0}' floatingLabel autoValidate> | |
<input is="core-input" name="{1}" type="email"> | |
</paper-input-decorator>""" | |
if 'label' in attrs: | |
print "Hello" | |
return format_html(html, attrs['label'], name) | |
else: | |
print attrs | |
return format_html(html, name, name) | |
else: | |
html = """<paper-input-decorator label='{0}' floatingLabel autoValidate> | |
<input is="core-input" name="{0}" value="{1}" type="email"> | |
</paper-input-decorator>""" | |
return format_html(html, name, value) |
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
class iCloudForm(forms.ModelForm): | |
class Meta: | |
model = iCloudLogin | |
fields = ['username', 'password'] | |
labels={'username': '', | |
'password': '',} | |
widgets = { | |
'username': PaperEmailInput(attrs={'label': "iCloud Email"}), | |
'password': PaperPasswordInput, | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment