from .models import BlogPost, Comment
from django.forms import ModelForm

class BlogPostForm(ModelForm):
    class Meta:
        model = BlogPost
        exclude = ('user',)

class CommentForm(ModelForm):
    class Meta:
        model = Comment
        exclude = ('post',)

from .models import BlogPost, Comment
from django.forms import ModelForm

class BlogPostForm(ModelForm):
    class Meta:
        model = BlogPost
        exclude = ('user',)

class CommentForm(ModelForm):
    class Meta:
        model = Comment
        exclude = ('post', 'user', 'date',)

Exclude fields from CommentForm that will be automatically inserted
Exclude fields from CommentForm that will be automatically inserted

  from .models import BlogPost, Comment
  from django.forms import ModelForm
  
  class BlogPostForm(ModelForm):
      class Meta:
          model = BlogPost
          exclude = ('user',)
  
  class CommentForm(ModelForm):
      class Meta:
          model = Comment
-         exclude = ('post',)
+         exclude = ('post', 'user', 'date',)
  
Exclude fields from CommentForm that will be automatically inserted
## Code Before:
from .models import BlogPost, Comment
from django.forms import ModelForm

class BlogPostForm(ModelForm):
    class Meta:
        model = BlogPost
        exclude = ('user',)

class CommentForm(ModelForm):
    class Meta:
        model = Comment
        exclude = ('post',)

## Instruction:
Exclude fields from CommentForm that will be automatically inserted
## Code After:
from .models import BlogPost, Comment
from django.forms import ModelForm

class BlogPostForm(ModelForm):
    class Meta:
        model = BlogPost
        exclude = ('user',)

class CommentForm(ModelForm):
    class Meta:
        model = Comment
        exclude = ('post', 'user', 'date',)
