
from django import forms

from apps.posters.models import Poster


class AddPosterForm(forms.ModelForm):
    when = forms.CharField(label=u"Event start", widget=forms.TextInput(attrs={'type': 'datetime-local'}))
    display_from = forms.CharField(label=u"Vis plakat fra", widget=forms.TextInput(attrs={'type': 'date'}))
    display_to = forms.CharField(label=u"Vis plakat til", widget=forms.TextInput(attrs={'type': 'date'}))
    class Meta:
        model = Poster
        fields = ['event', 'amount', 'description',
                  'price', 'display_from', 'display_to', 'comments']

class EditPosterForm(forms.ModelForm):
    
    class Meta:
        model = Poster
        fields = ['event', 'amount', 'description',
                  'price', 'display_to', 'display_from', 'comments', 'finished']


from django import forms

from apps.posters.models import Poster


class AddPosterForm(forms.ModelForm):
    display_from = forms.CharField(label=u"Vis plakat fra", widget=forms.TextInput(attrs={'type': 'date'}))
    display_to = forms.CharField(label=u"Vis plakat til", widget=forms.TextInput(attrs={'type': 'date'}))
    class Meta:
        model = Poster
        fields = ['event', 'amount', 'description',
                  'price', 'display_from', 'display_to', 'comments']

class EditPosterForm(forms.ModelForm):
    
    class Meta:
        model = Poster
        fields = ['event', 'amount', 'description',
                  'price', 'display_to', 'display_from', 'comments', 'finished']

Remove event start field from form
Remove event start field from form

  
  from django import forms
  
  from apps.posters.models import Poster
  
  
  class AddPosterForm(forms.ModelForm):
-     when = forms.CharField(label=u"Event start", widget=forms.TextInput(attrs={'type': 'datetime-local'}))
      display_from = forms.CharField(label=u"Vis plakat fra", widget=forms.TextInput(attrs={'type': 'date'}))
      display_to = forms.CharField(label=u"Vis plakat til", widget=forms.TextInput(attrs={'type': 'date'}))
      class Meta:
          model = Poster
          fields = ['event', 'amount', 'description',
                    'price', 'display_from', 'display_to', 'comments']
  
  class EditPosterForm(forms.ModelForm):
      
      class Meta:
          model = Poster
          fields = ['event', 'amount', 'description',
                    'price', 'display_to', 'display_from', 'comments', 'finished']
  
Remove event start field from form
## Code Before:

from django import forms

from apps.posters.models import Poster


class AddPosterForm(forms.ModelForm):
    when = forms.CharField(label=u"Event start", widget=forms.TextInput(attrs={'type': 'datetime-local'}))
    display_from = forms.CharField(label=u"Vis plakat fra", widget=forms.TextInput(attrs={'type': 'date'}))
    display_to = forms.CharField(label=u"Vis plakat til", widget=forms.TextInput(attrs={'type': 'date'}))
    class Meta:
        model = Poster
        fields = ['event', 'amount', 'description',
                  'price', 'display_from', 'display_to', 'comments']

class EditPosterForm(forms.ModelForm):
    
    class Meta:
        model = Poster
        fields = ['event', 'amount', 'description',
                  'price', 'display_to', 'display_from', 'comments', 'finished']

## Instruction:
Remove event start field from form
## Code After:

from django import forms

from apps.posters.models import Poster


class AddPosterForm(forms.ModelForm):
    display_from = forms.CharField(label=u"Vis plakat fra", widget=forms.TextInput(attrs={'type': 'date'}))
    display_to = forms.CharField(label=u"Vis plakat til", widget=forms.TextInput(attrs={'type': 'date'}))
    class Meta:
        model = Poster
        fields = ['event', 'amount', 'description',
                  'price', 'display_from', 'display_to', 'comments']

class EditPosterForm(forms.ModelForm):
    
    class Meta:
        model = Poster
        fields = ['event', 'amount', 'description',
                  'price', 'display_to', 'display_from', 'comments', 'finished']
