How to correctly access parent form's field/s from inline form clean method during Update

176 Views Asked by At

I am a little perplexed. Using CreateView, When I try to get the data of a field in the parent table's form from the (child table's) inline form's clean method I can do that:

def clean(self):
    super(CreateMyItemsForm, self).clean()
    cleaned_data = super(CreateMyItemsForm, self).clean()
    var_date = self.data.get('valid_to_date')    #   NOTE: **valid_to_date** is a field in the parent table

However, during update (using UpdateView) the same method fails.

Why? What am I doing wrong here?

Thanks.

0

There are 0 best solutions below