fnp
/
wolnelektury.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Adding polls to croudfunding
[wolnelektury.git]
/
apps
/
sponsors
/
admin.py
diff --git
a/apps/sponsors/admin.py
b/apps/sponsors/admin.py
index
c66a086
..
274fe90
100644
(file)
--- a/
apps/sponsors/admin.py
+++ b/
apps/sponsors/admin.py
@@
-1,21
+1,27
@@
-from django.db import models
+# -*- coding: utf-8 -*-
+# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
+# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
+#
from django.contrib import admin
from django.contrib import admin
+from jsonfield import JSONField
+from sponsors import models
+from sponsors import widgets
-from sponsors.models import Sponsor, SponsorGroup
-from sponsors.widgets import OrderedSelectMultiple
-class SponsorGroupAdmin(admin.ModelAdmin):
- formfield_overrides = {
- models.CommaSeparatedIntegerField: {'widget': OrderedSelectMultiple},
- }
+class SponsorAdmin(admin.ModelAdmin):
list_display = ('name',)
search_fields = ('name',)
ordering = ('name',)
list_display = ('name',)
search_fields = ('name',)
ordering = ('name',)
-class SponsorAdmin(admin.ModelAdmin):
+
+class SponsorPageAdmin(admin.ModelAdmin):
+ formfield_overrides = {
+ JSONField: {'widget': widgets.SponsorPageWidget},
+ }
list_display = ('name',)
search_fields = ('name',)
ordering = ('name',)
list_display = ('name',)
search_fields = ('name',)
ordering = ('name',)
-admin.site.register(SponsorGroup, SponsorGroupAdmin)
-admin.site.register(Sponsor, SponsorAdmin)
+
+admin.site.register(models.Sponsor, SponsorAdmin)
+admin.site.register(models.SponsorPage, SponsorPageAdmin)