I am making a custom form object in Django which has an overrided __init__ method. The purpose of overriding the method is to dynamically generate drop-down boxes based on t
You can dynamically modify your form by using the self.fields
dict. Something like this may work for you:
class TicketForm(forms.Form):
Type = Type.GetTicketTypeField()
def __init__(self, ticket, *args, **kwargs):
super(TicketForm, self).__init__(*args, **kwargs)
self.fields['state'] = State.GetTicketStateField(ticket.Type)