diff options
Diffstat (limited to 'app/notes/admin.py')
-rw-r--r-- | app/notes/admin.py | 34 |
1 files changed, 26 insertions, 8 deletions
diff --git a/app/notes/admin.py b/app/notes/admin.py index 794e882..3e15be2 100644 --- a/app/notes/admin.py +++ b/app/notes/admin.py @@ -1,19 +1,37 @@ from django.contrib import admin from django.contrib.gis.admin import OSMGeoAdmin -from notes.models import Note -from django import forms +from notes.models import Note, LuxNote +from utils.widgets import AdminImageWidget, LGEntryForm, LGEntryFormSmall, OLAdminBase -class NoteModelForm(forms.ModelForm): - body_markdown = forms.CharField(widget=forms.Textarea(attrs={'maxlength': 40000, 'rows': 20, 'cols': 75}), label='Note') - class Meta: - model = Note - fields = '__all__' +class LuxNoteAdmin(OLAdminBase): + form = LGEntryFormSmall + prepopulated_fields = {"slug": ('title',)} + list_display = ('slug', 'pub_date', 'location') + fieldsets = ( + ('Note', { + 'fields': ( + ('title', 'slug'), + 'body_markdown', + 'pub_date', + 'point' + ), + 'classes': ( + 'show', + 'extrapretty', + 'wide' + ) + } + ), + ) + + +admin.site.register(LuxNote, LuxNoteAdmin) class NoteAdmin(OSMGeoAdmin): - form = NoteModelForm + form = LGEntryForm list_display = ('slug', 'date_created', 'location', 'twitter_id') list_filter = ('location',) prepopulated_fields = {"slug": ('title',)} |