You should simply override get_form_class
.
(Also I'm not sure why you're querying for person
: that object is the same is self.get_object()
already, so there's no point getting the ID of that then querying again.)
def get_form_class(self):
if self.object.somefield:
return OneFormClass
else:
return SomeOtherFormClass