def cell_count(inline_admin_form):
 count = 1
 for fieldset in inline_admin_form:
  for line in fieldset:
   for field in line:
    count += 1
 if inline_admin_form.formset.can_delete:
  count += 1
 return count

def cell_count ( inline_admin_form ) : count = 1 for fieldset in inline_admin_form : for line in fieldset : for field in line : count += 1 if inline_admin_form . formset . can_delete : count += 1 return count
returns the number of cells used in a tabular inline .