class Game(models.Model):
name = models.CharField(max_length=256)
def __str__(self):
return self.name
class Category(models.Model):
name = models.CharField(max_length=100)
games = models.ManyToManyField(Game)
def __str__(self):
return self.name
and the following admin code:
...
class GameInline(nested_admin.nested.NestedTabularInline):
model = Category.games.through
autocomplete_fields = ('game',)
can_delete = False
verbose_name = "Game"
extra = 0 # Otherwise 3 empty relations are shows
@admin.register(Category)
class CategoryAdmin(NestedModelAdmin):
inlines = [GameInline]
search_fields = ("name",)
fields = ("name",)
I have the following models:
and the following admin code:
Is it possible to remove the text in the red box?