[Django]-Abstract form or form composition in django?

4👍

Multiple Inheritance won’t do what you want, if they all implement clean(), only the first mixin clean() will be called. How about simple polymorphism?

class RideForm(RideConditionPartForm):

    def clean():
        super clean()
        #other stuff

class RideConditionPartForm(RideGeographyPartForm):
   def clean():
     super clean()
     #other stuff

Leave a comment