Is there a way to access the model instance that is going to be presented in a generic.DetailView in views.py before the template gets rendered? Something like the hypothetical function here:
class MyModelDetailView(LoginRequiredMixin, generic.DetailView):
model = MyModel
template_name_suffix = '_details'
def do_some_initial_stuff(model_instance):
# do stuff to model_instace,
# like assigning fields, creating context variables based on existing fields, etc.
Ultimately, I would like have a user click a button for a specific model instance in one template, then get directed to this generic.DetailView template where the model is presented with some of its field values changed and some other stuff (eg. the model may have a field that acknowledges that the this user clicked the button in the previous template). Suggestions on the most efficient way to do this would be appreciated. Thanks :)