from django.contrib import admin

from tasks.models import Task, TaskLabels


class LabelInline(admin.TabularInline):
    """
    A class that adds a widget for TaskLabels.

    Django admin doesn't show a widget for m2m by default.
    """

    model = TaskLabels
    extra = 1  # only a form for 1 label initially


class TaskAdmin(admin.ModelAdmin):
    inlines = (LabelInline,)


admin.site.register(Task, TaskAdmin)

741ab65e78afab8b269921ebfa51a9ce1c0f9444
<mask token>


class LabelInline(admin.TabularInline):
    <mask token>
    model = TaskLabels
    extra = 1


class TaskAdmin(admin.ModelAdmin):
    inlines = LabelInline,


<mask token>

<mask token>


class LabelInline(admin.TabularInline):
    """
    A class that adds a widget for TaskLabels.

    Django admin doesn't show a widget for m2m by default.
    """
    model = TaskLabels
    extra = 1


class TaskAdmin(admin.ModelAdmin):
    inlines = LabelInline,


<mask token>

<mask token>


class LabelInline(admin.TabularInline):
    """
    A class that adds a widget for TaskLabels.

    Django admin doesn't show a widget for m2m by default.
    """
    model = TaskLabels
    extra = 1


class TaskAdmin(admin.ModelAdmin):
    inlines = LabelInline,


admin.site.register(Task, TaskAdmin)

from django.contrib import admin
from tasks.models import Task, TaskLabels


class LabelInline(admin.TabularInline):
    """
    A class that adds a widget for TaskLabels.

    Django admin doesn't show a widget for m2m by default.
    """
    model = TaskLabels
    extra = 1


class TaskAdmin(admin.ModelAdmin):
    inlines = LabelInline,


admin.site.register(Task, TaskAdmin)

from django.contrib import admin

from tasks.models import Task, TaskLabels


class LabelInline(admin.TabularInline):
    """
    A class that adds a widget for TaskLabels.

    Django admin doesn't show a widget for m2m by default.
    """

    model = TaskLabels
    extra = 1  # only a form for 1 label initially


class TaskAdmin(admin.ModelAdmin):
    inlines = (LabelInline,)


admin.site.register(Task, TaskAdmin)
