Welcome, guest | Sign In | My Account | Store | Cart

this is a teste of admin with tabular line

Python, 19 lines
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
from django.contrib import admin
from cadastro_os.models import *

class DesenvolveInline(admin.TabularInline):
    model = Desenvolve
    extra = 1

class OSAdmin(admin.ModelAdmin):
    inlines= (DesenvolveInline,)

class DesenvolveAdmin(admin.ModelAdmin):
    list_display = ('func_id','os_id')

admin.site.register(Projeto)
admin.site.register(Funcionario,OSAdmin)
admin.site.register(Membro)
admin.site.register(Andamento)
admin.site.register(OS,OSAdmin)
admin.site.register(Desenvolve,DesenvolveAdmin)

2 comments

Gabriel Genellina 14 years, 7 months ago  # | flag

Could you explain better what's this for?

Zhang Guangboo 14 years, 7 months ago  # | flag

Django admin.but I dont know what's meaning?