from django import forms
from .models import User, Snippet, Profile


class SnippetForm(forms.ModelForm):

    def __init__(self, *args, **kwargs):
        super(SnippetForm, self).__init__(*args, **kwargs)
        self.fields['author'].disabled = True
        self.fields['author'].widget = forms.HiddenInput()
        self.fields['copies'].disabled = True
        self.fields['copies'].widget = forms.HiddenInput()


    class Meta:
        model = Snippet
        fields = ['title', 'author', 'code', 'language', 'copies']


class ProfileForm(forms.ModelForm):

    def __init__(self, *args, **kwargs):
        super(ProfileForm, self).__init__(*args, **kwargs)
        self.fields['user'].disabled = True
        self.fields['user'].widget = forms.HiddenInput()


    class Meta:
        model = Profile
        fields = ['user', 'picture']

b0c28b2e121f58619d863e01bf9539bf3ed2f202
<mask token>


class ProfileForm(forms.ModelForm):

    def __init__(self, *args, **kwargs):
        super(ProfileForm, self).__init__(*args, **kwargs)
        self.fields['user'].disabled = True
        self.fields['user'].widget = forms.HiddenInput()


    class Meta:
        model = Profile
        fields = ['user', 'picture']

<mask token>


class SnippetForm(forms.ModelForm):
    <mask token>


    class Meta:
        model = Snippet
        fields = ['title', 'author', 'code', 'language', 'copies']


class ProfileForm(forms.ModelForm):

    def __init__(self, *args, **kwargs):
        super(ProfileForm, self).__init__(*args, **kwargs)
        self.fields['user'].disabled = True
        self.fields['user'].widget = forms.HiddenInput()


    class Meta:
        model = Profile
        fields = ['user', 'picture']

<mask token>


class SnippetForm(forms.ModelForm):

    def __init__(self, *args, **kwargs):
        super(SnippetForm, self).__init__(*args, **kwargs)
        self.fields['author'].disabled = True
        self.fields['author'].widget = forms.HiddenInput()
        self.fields['copies'].disabled = True
        self.fields['copies'].widget = forms.HiddenInput()


    class Meta:
        model = Snippet
        fields = ['title', 'author', 'code', 'language', 'copies']


class ProfileForm(forms.ModelForm):

    def __init__(self, *args, **kwargs):
        super(ProfileForm, self).__init__(*args, **kwargs)
        self.fields['user'].disabled = True
        self.fields['user'].widget = forms.HiddenInput()


    class Meta:
        model = Profile
        fields = ['user', 'picture']

from django import forms
from .models import User, Snippet, Profile


class SnippetForm(forms.ModelForm):

    def __init__(self, *args, **kwargs):
        super(SnippetForm, self).__init__(*args, **kwargs)
        self.fields['author'].disabled = True
        self.fields['author'].widget = forms.HiddenInput()
        self.fields['copies'].disabled = True
        self.fields['copies'].widget = forms.HiddenInput()


    class Meta:
        model = Snippet
        fields = ['title', 'author', 'code', 'language', 'copies']


class ProfileForm(forms.ModelForm):

    def __init__(self, *args, **kwargs):
        super(ProfileForm, self).__init__(*args, **kwargs)
        self.fields['user'].disabled = True
        self.fields['user'].widget = forms.HiddenInput()


    class Meta:
        model = Profile
        fields = ['user', 'picture']
