I\'m using Django\'s TabularInline
admin view to edit category objects related to a main topic object, as shown here:
I took a slightly different approach. It's a little hackish. This replaces the "original" string with a blank string, so the td for class=original still gets rendered leaving a gap above the edit boxes.
I like the CSS solution better (I had to use 'padding-top: 5px;' to get the rendering right).
class Model(model.Model):
general_questions = models.TextField()
_hide = False
def __unicode__(self):
if _hide:
return ''
class ModelInline(admin.TabularInline):
model = Model
extra = 0
class ModelAdmin(admin.ModelAdmin):
inlines = [ModelInline, ]
def render_change_form(self, request, context, *args, **kwargs):
for formset in context['inline_admin_formsets']:
qs = formset.formset.queryset
for model_obj in qs:
model_obj._hide = True
return super(ModelAdmin, self).render_change_form(request, context, *args, **kwargs)