Skip to content

How to hide ManyToManyField instance name #203

Open
@autoantwort

Description

@autoantwort

I have the following models:

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",)

Is it possible to remove the text in the red box?
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions