fixes for saving courses in the admin interface
authorBryan <btbonval@gmail.com>
Thu, 2 Jan 2014 20:49:56 +0000 (15:49 -0500)
committerBryan <btbonval@gmail.com>
Thu, 2 Jan 2014 20:49:56 +0000 (15:49 -0500)
karmaworld/apps/notes/admin.py
karmaworld/apps/notes/models.py

index ff4c6ee558340ec1e1f20e4b35561ac5c3710f5c..90e17e698f46103c34f14ed5304cef17de0bd21d 100644 (file)
@@ -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)
index fd76b0999dc8e0751d02de1e23baadea66f0d03f..9beb0d5316d735c2530b9570182b22231ca0cc20 100644 (file)
@@ -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)