python - error site register django -
i have 2 classes in admin.py. because can't register them twice, don't know how fix problem. says: "register() takes @ 3 arguments (4 given)". code:
class tesi_availableadmin (admin.modeladmin): model=tesi fieldsets = ( (none, { 'fields': ('teacher', 'title', 'description', 'date') }), ) list_filter = ['date'] search_fields = ['teacher', 'title', 'description'] def queryset(self, request): qs=super(tesi_availableadmin, self).queryset(request) return qs.filter(state='available') class tesi_requestadmin (admin.modeladmin): models=tesi fieldsets = ( (none, { 'fields': ('teacher', 'title', 'description', 'date', 'student') }), ) list_filter = ['date'] search_fields = ['teacher', 'title', 'description'] def queryset(self, request): qs=super(tesi_requestadmin, self).queryset(request) return qs.filter(state='request') admin.site.register(tesi,tesi_availableadmin) admin.site.register(tesi_requestadmin)
do know how can register classes? thank you!
Comments
Post a Comment