Advertisement
Guest User

Untitled

a guest
Apr 9th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. class ProjectForm(forms.ModelForm):
  2. def __init__(self, user=None, *args, **kwargs):
  3. super().__init__(*args, **kwargs)
  4. self.user = user
  5.  
  6. class Meta:
  7. model = Project
  8. fields = ['colour', 'name']
  9. widgets = {
  10. 'colour': forms.TextInput(attrs={'class': 'form-control', 'type': 'color'}),
  11. 'name': forms.TextInput(attrs={'class': 'form-control', 'placeholder': 'project name', 'autofocus': 'autofocus'})
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement