From 2f6c9b12393674be624f2e685b521f787bd7c62b Mon Sep 17 00:00:00 2001 From: Bryan Date: Thu, 2 Jan 2014 15:49:56 -0500 Subject: [PATCH] fixes for saving courses in the admin interface --- karmaworld/apps/notes/admin.py | 4 ++-- karmaworld/apps/notes/models.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/karmaworld/apps/notes/admin.py b/karmaworld/apps/notes/admin.py index ff4c6ee..90e17e6 100644 --- a/karmaworld/apps/notes/admin.py +++ b/karmaworld/apps/notes/admin.py @@ -10,9 +10,9 @@ from karmaworld.apps.notes.models import Note class NoteAdmin(admin.ModelAdmin): """ an Admin handler for the Note model that handles autocomplete to Course """ - raw_id_fields = ('course',) + raw_id_fields = ('course','user') autocomplete_lookup_fields = { - 'fk': ['course'] + 'fk': ('course', 'user'), } admin.site.register(Note, NoteAdmin) diff --git a/karmaworld/apps/notes/models.py b/karmaworld/apps/notes/models.py index fd76b09..9beb0d5 100644 --- a/karmaworld/apps/notes/models.py +++ b/karmaworld/apps/notes/models.py @@ -47,8 +47,8 @@ class Document(models.Model): slug = models.SlugField(max_length=255, null=True) # metadata relevant to the Upload process - user = models.ForeignKey('users.KarmaUser', null=True, on_delete=SET_NULL) - ip = models.IPAddressField(blank=True, null=True, + user = models.ForeignKey('users.KarmaUser', blank=True, null=True, on_delete=SET_NULL) + ip = models.GenericIPAddressField(blank=True, null=True, help_text=u"IP address of the uploader") uploaded_at = models.DateTimeField(null=True, default=datetime.datetime.utcnow) -- 2.25.1