code: def handle_dimensions(self, obj):
          
          from .tables import WidgetDimensionFormset
          from ..models import WidgetDimension
          formset = WidgetDimensionFormset(
              self.request.POST, prefix='dimensions')
  
          if formset.is_valid():
              formset.save()
          else:
              for form in formset.forms:
                  if form.is_valid():
                      if 'id' in form.cleaned_data:
                          form.save()
                  else:
                      # little ugly
                      data = form.cleaned_data
                      data['widget_type'] = \
                          ContentType.objects.get_for_model(obj)
                      data['widget_id'] = obj.id
                      data.pop('DELETE', None)
                      wd = WidgetDimension(**data)
                      # do not update widget view
                      wd.update_view = False
                      wd.save()
  
          if formset.is_valid():
              # delete objects
              for obj in formset.deleted_objects:
                  if obj.id != None:
                      obj.delete()
          return True
docs: save dimensions