from django.forms import ModelForm
from breach.models import Target, Victim


class TargetForm(ModelForm):
    class Meta:
        model = Target
        fields = (
            'name',
            'endpoint',
            'prefix',
            'alphabet',
            'secretlength',
            'alignmentalphabet',
            'recordscardinality',
            'method'
        )


class VictimForm(ModelForm):
    class Meta:
        model = Victim
        fields = (
            'sourceip',
        )


class AttackForm(ModelForm):
    class Meta:
        model = Victim
        fields = (
            'id',
        )

from django.forms import ModelForm
from breach.models import Target, Victim


class TargetForm(ModelForm):
    class Meta:
        model = Target
        fields = (
            'name',
            'endpoint',
            'prefix',
            'alphabet',
            'secretlength',
            'alignmentalphabet',
            'recordscardinality',
            'method'
        )


class VictimForm(ModelForm):
    class Meta:
        model = Victim
        fields = (
            'sourceip',
        )


class AttackForm(ModelForm):
    class Meta:
        model = Victim
        fields = (
            'sourceip',
            'target'
        )

Add sourceip and target parameters to AttackForm
Add sourceip and target parameters to AttackForm

  from django.forms import ModelForm
  from breach.models import Target, Victim
  
  
  class TargetForm(ModelForm):
      class Meta:
          model = Target
          fields = (
              'name',
              'endpoint',
              'prefix',
              'alphabet',
              'secretlength',
              'alignmentalphabet',
              'recordscardinality',
              'method'
          )
  
  
  class VictimForm(ModelForm):
      class Meta:
          model = Victim
          fields = (
              'sourceip',
          )
  
  
  class AttackForm(ModelForm):
      class Meta:
          model = Victim
          fields = (
-             'id',
+             'sourceip',
+             'target'
          )
  
Add sourceip and target parameters to AttackForm
## Code Before:
from django.forms import ModelForm
from breach.models import Target, Victim


class TargetForm(ModelForm):
    class Meta:
        model = Target
        fields = (
            'name',
            'endpoint',
            'prefix',
            'alphabet',
            'secretlength',
            'alignmentalphabet',
            'recordscardinality',
            'method'
        )


class VictimForm(ModelForm):
    class Meta:
        model = Victim
        fields = (
            'sourceip',
        )


class AttackForm(ModelForm):
    class Meta:
        model = Victim
        fields = (
            'id',
        )

## Instruction:
Add sourceip and target parameters to AttackForm
## Code After:
from django.forms import ModelForm
from breach.models import Target, Victim


class TargetForm(ModelForm):
    class Meta:
        model = Target
        fields = (
            'name',
            'endpoint',
            'prefix',
            'alphabet',
            'secretlength',
            'alignmentalphabet',
            'recordscardinality',
            'method'
        )


class VictimForm(ModelForm):
    class Meta:
        model = Victim
        fields = (
            'sourceip',
        )


class AttackForm(ModelForm):
    class Meta:
        model = Victim
        fields = (
            'sourceip',
            'target'
        )
