add django-filepicker and a document_upload app for the new document upload workflow
authorSeth Woodworth <seth@sethish.com>
Tue, 27 Aug 2013 13:39:12 +0000 (09:39 -0400)
committerSeth Woodworth <seth@sethish.com>
Tue, 27 Aug 2013 13:39:12 +0000 (09:39 -0400)
karmaworld/apps/document_upload/__init__.py [new file with mode: 0644]
karmaworld/apps/document_upload/models.py [new file with mode: 0644]
karmaworld/apps/document_upload/tests.py [new file with mode: 0644]
karmaworld/apps/document_upload/views.py [new file with mode: 0644]
karmaworld/settings/common.py
reqs/common.txt

diff --git a/karmaworld/apps/document_upload/__init__.py b/karmaworld/apps/document_upload/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/karmaworld/apps/document_upload/models.py b/karmaworld/apps/document_upload/models.py
new file mode 100644 (file)
index 0000000..63f19f9
--- /dev/null
@@ -0,0 +1,27 @@
+import datetime
+
+from django.db import models
+
+import django_filepicker
+
+class IntakeDoc(models.Model):
+    fp_note = django_filepicker.models.FPFileField(upload_to='queue/%Y/%m/%j/',
+                help_text=u"An uploaded file reference from Filepicker.io")
+    form    = models.TextField(max_length=1024,
+                help_text=u"A serilized version of the note data form")
+    ip      = models.IPAddressField(blank=True, null=True,
+                help_text=u"IP address of the uploader")
+
+    uploaded_at     = models.DateTimeField(null=True, default=datetime.datetime.utcnow)
+
+    class Meta:
+        """ Sort files most recent first """
+        ordering = ['-uploaded_at']
+
+
+    def __unicode__(self):
+        return u"{0} @ {1}".format(self.ip, self.uploaded_at)
+
+    def convert_to_note(self):
+        """ polymorph this object into a note.models.Note object  """
+        pass
diff --git a/karmaworld/apps/document_upload/tests.py b/karmaworld/apps/document_upload/tests.py
new file mode 100644 (file)
index 0000000..501deb7
--- /dev/null
@@ -0,0 +1,16 @@
+"""
+This file demonstrates writing tests using the unittest module. These will pass
+when you run "manage.py test".
+
+Replace this with more appropriate tests for your application.
+"""
+
+from django.test import TestCase
+
+
+class SimpleTest(TestCase):
+    def test_basic_addition(self):
+        """
+        Tests that 1 + 1 always equals 2.
+        """
+        self.assertEqual(1 + 1, 2)
diff --git a/karmaworld/apps/document_upload/views.py b/karmaworld/apps/document_upload/views.py
new file mode 100644 (file)
index 0000000..60f00ef
--- /dev/null
@@ -0,0 +1 @@
+# Create your views here.
index 1adc653cbcee3840c624ee35aa1f493ca7f09e0c..078d3a8eefa243a26f36da3748bc0a17b17415a2 100644 (file)
@@ -72,7 +72,7 @@ TIME_ZONE = 'America/New_York'
 LANGUAGE_CODE = 'en-us'
 
 # See: https://docs.djangoproject.com/en/dev/ref/settings/#site-id
-SITE_ID = 1
+SITE_ID = 2
 
 # See: https://docs.djangoproject.com/en/dev/ref/settings/#use-i18n
 USE_I18N = True
@@ -209,6 +209,7 @@ LOCAL_APPS = (
     'karmaworld.apps.notes',
     'karmaworld.apps.courses',
     'karmaworld.apps.ajaxuploader',
+    'karmaworld.apps.document_upload',
 )
 
 # See: https://docs.djangoproject.com/en/dev/ref/settings/#installed-apps
index 2a42a6bd966b5a0bbe090edd1bd0305950b1aad2..fbfe11c23d5d3b3150fec7b177a81f6e800e058e 100644 (file)
@@ -1,13 +1,14 @@
 Django>=1.4.0,<=1.4.9
-django-celery==3.0.11
+django-celery==3.0.21
 django-compressor==1.2
 Fabric==1.5.3
 South==0.7.6
 Sphinx==1.1.3
 supervisor==3.0b1
-git+git://github.com/FinalsClub/django-taggit.git
 oauth2client==1.0
 urllib3==1.5
 google-api-python-client==1.0
 django-grappelli==2.4.3
 lxml==3.1.0
+git+https://github.com/FinalsClub/django-taggit.git
+django-filepicker==0.1.4