File tree Expand file tree Collapse file tree 6 files changed +44
-5
lines changed
Expand file tree Collapse file tree 6 files changed +44
-5
lines changed Original file line number Diff line number Diff line change 22from django .db import models
33
44from content .models import Content
5+ from content .resources import ContentResource
56
67from martor .widgets import AdminMartorWidget
8+ from import_export .admin import ImportExportModelAdmin
79
810
9- class ContentAdmin (admin .ModelAdmin ):
11+ class ContentAdmin (ImportExportModelAdmin ):
12+ resource_class = ContentResource
1013 list_display = (
1114 "slug" ,
1215 "title" ,
Original file line number Diff line number Diff line change 1+ from import_export import resources
2+
3+ from content .models import Content
4+
5+
6+ class ContentResource (resources .ModelResource ):
7+ class Meta :
8+ model = Content
Original file line number Diff line number Diff line change 11from django .contrib import admin
22
3+ from import_export .admin import ImportExportModelAdmin
4+
35from news .models import News
6+ from news .resources import NewsResource
47
58
6- class NewsAdmin (admin .ModelAdmin ):
9+ class NewsAdmin (ImportExportModelAdmin ):
10+ resource_class = NewsResource
711 app_label = "News"
812 list_display = (
913 "id" ,
Original file line number Diff line number Diff line change 1+ from import_export import resources
2+
3+ from news .models import News
4+
5+
6+ class NewsResource (resources .ModelResource ):
7+ class Meta :
8+ model = News
Original file line number Diff line number Diff line change 33
44from import_export .admin import ImportExportModelAdmin
55
6- from .models import Proposal , ProgramCategory
6+ from program .models import Proposal , ProgramCategory
7+ from program .resources import ProgramCategoryResource , ProposalResource
78
89
9- class ProgramCategoryAdmin (admin .ModelAdmin ):
10+ class ProgramCategoryAdmin (ImportExportModelAdmin ):
11+ resource_class = ProgramCategoryResource
1012 list_display = ("name" ,)
1113
1214
1315admin .site .register (ProgramCategory , ProgramCategoryAdmin )
1416
1517
16- class ProgramAdmin (admin .ModelAdmin ):
18+ class ProgramAdmin (ImportExportModelAdmin ):
19+ resource_class = ProposalResource
1720 list_display = (
1821 "title" ,
1922 "user_name" ,
Original file line number Diff line number Diff line change 1+ from program .models import ProgramCategory , Proposal
2+
3+ from import_export import resources
4+
5+
6+ class ProgramCategoryResource (resources .ModelResource ):
7+ class Meta :
8+ model = ProgramCategory
9+
10+
11+ class ProposalResource (resources .ModelResource ):
12+ class Meta :
13+ model = Proposal
You can’t perform that action at this time.
0 commit comments