Open nprati01 opened 1 year ago
Other than saying, great work - I would say in this situation you did achieve your goals and your options were limited by the associated ids / FKs you needed to get your three models to work together. There are some pros / cons associated with this approach as well as the View CBV or the Create CBV and in this case there is not a magic bullet (that I know of) for updating / accessing across several related models.
If you were looking for practice a refactor, I would look at the base View CBV as a place to start, or a generic FormView class which is provided context through a get_context_data()
custom method.
I included this code as a glow snippet primarily because it is provides functionality between between both the Festival Model and MyFestival Model. While Im listing it as a Glow because of the relationship it creates I also would describe it as a glow. I wanted to use a class based view for this view function but after several attempts was unable to make it work and changed it to a function based view.