def __init__(self, *args, **kwargs):
    self.user = kwargs.pop('user')
    self.object = kwargs.pop('object')
    super().__init__(*args, **kwargs)
    if ((not self.instance) or (self.instance.marked_flag == Rating.FLAG_NONE)):
        self.fields['marked_flag'].choices = Rating.FLAG_CHOICES[1:]
        self.fields['marked_flag'].required = True
        self.initial['marked_flag'] = Rating.FLAG_SPAM
    if (self.data.get(self.add_prefix('marked_flag')) == Rating.FLAG_OTHER):
        self.fields['comment'].required = True
def __init__(self, *args, **kwargs):
    self.user = kwargs.pop('user')
    self.object = kwargs.pop('object')
    super().__init__(*args, **kwargs)
    if ((not self.instance) or (self.instance.marked_flag == Rating.FLAG_NONE)):
        self.fields['marked_flag'].choices = Rating.FLAG_CHOICES[1:]
        self.fields['marked_flag'].required = True
        self.initial['marked_flag'] = Rating.FLAG_SPAM
    if (self.data.get(self.add_prefix('marked_flag')) == Rating.FLAG_OTHER):
        self.fields['comment'].required = True