from django import forms
from django.contrib.auth.models import User

from chats.models import Chat
from profiles.models import FriendGroup


class PublicChatForm(forms.ModelForm):
    """Public-facing Chat form used in the web-interface for users."""
    
    class Meta:
        fields = ('text',)
        model = Chat

from django import forms
from django.contrib.auth.models import User

from chats.models import Chat
from profiles.models import FriendGroup


class PublicChatForm(forms.ModelForm):
    """Public-facing Chat form used in the web-interface for users."""
    
    class Meta:
        fields = (
            'friend_groups',
            'text',
        )
        model = Chat

Add friend_groups to the ChatForm
Add friend_groups to the ChatForm

  from django import forms
  from django.contrib.auth.models import User
  
  from chats.models import Chat
  from profiles.models import FriendGroup
  
  
  class PublicChatForm(forms.ModelForm):
      """Public-facing Chat form used in the web-interface for users."""
      
      class Meta:
-         fields = ('text',)
+         fields = (
+             'friend_groups',
+             'text',
+         )
          model = Chat
  
Add friend_groups to the ChatForm
## Code Before:
from django import forms
from django.contrib.auth.models import User

from chats.models import Chat
from profiles.models import FriendGroup


class PublicChatForm(forms.ModelForm):
    """Public-facing Chat form used in the web-interface for users."""
    
    class Meta:
        fields = ('text',)
        model = Chat

## Instruction:
Add friend_groups to the ChatForm
## Code After:
from django import forms
from django.contrib.auth.models import User

from chats.models import Chat
from profiles.models import FriendGroup


class PublicChatForm(forms.ModelForm):
    """Public-facing Chat form used in the web-interface for users."""
    
    class Meta:
        fields = (
            'friend_groups',
            'text',
        )
        model = Chat
