diff options
author | luxagraf <sng@luxagraf.net> | 2015-10-25 08:41:56 -0400 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2015-10-25 08:41:56 -0400 |
commit | 280ccc3920b9c761c3911cf7e4d5c40555c37ce9 (patch) | |
tree | 8df8a50a97093444990594ffad56da423111dab2 | |
parent | f03cf2d8ad179e1a5f672b7f719b80252a788719 (diff) |
added prepopulate to note slugfield admin, fixed bug in blog imports and updated note build.py to work with djanog 1.9
-rw-r--r-- | app/blog/models.py | 2 | ||||
-rw-r--r-- | app/notes/admin.py | 1 | ||||
-rw-r--r-- | app/notes/build.py | 3 |
3 files changed, 4 insertions, 2 deletions
diff --git a/app/blog/models.py b/app/blog/models.py index 03fb306..ed0bb40 100644 --- a/app/blog/models.py +++ b/app/blog/models.py @@ -205,7 +205,7 @@ import shutil from django_gravatar.helpers import get_gravatar_url, has_gravatar, get_gravatar_profile_url, calculate_gravatar_hash from django.dispatch import receiver from django_comments.signals import comment_was_posted -from django_comments import Comment +from django_comments.models import Comment from django_comments.moderation import CommentModerator, moderator class EntryModerator(CommentModerator): diff --git a/app/notes/admin.py b/app/notes/admin.py index ad3e84b..794e882 100644 --- a/app/notes/admin.py +++ b/app/notes/admin.py @@ -16,6 +16,7 @@ class NoteAdmin(OSMGeoAdmin): form = NoteModelForm list_display = ('slug', 'date_created', 'location', 'twitter_id') list_filter = ('location',) + prepopulated_fields = {"slug": ('title',)} fieldsets = ( ('Note', { 'fields': ( diff --git a/app/notes/build.py b/app/notes/build.py index 4923baf..96c4812 100644 --- a/app/notes/build.py +++ b/app/notes/build.py @@ -1,4 +1,5 @@ from builder.base import * +from django.apps import apps class BuildNotes(Build): @@ -12,7 +13,7 @@ class BuildNotes(Build): return self.get_model().objects.all().order_by('-date_created') def get_model(self): - return get_model('notes', 'note') + return apps.get_model('notes', 'note') def build_detail_pages(self): ''' |