[Django]-Exclude form field when calling form from view

3👍

Write a constructor for the form class

def __init__ (self, show_title=True):
    super (BaseClass, self).__init__()
    if not show_title:
        del self.fields['title']

Leave a comment