The comicsporn django app : the beginning.
authorJérôme Benoit <jerome.benoit@grenouille.com>
Wed, 30 Oct 2013 23:40:54 +0000 (00:40 +0100)
committerJérôme Benoit <jerome.benoit@grenouille.com>
Wed, 30 Oct 2013 23:40:54 +0000 (00:40 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@grenouille.com>
comicsporn/__init__.py [new file with mode: 0644]
comicsporn/__init__.pyc [new file with mode: 0644]
comicsporn/models.py [new file with mode: 0644]
comicsporn/models.pyc [new file with mode: 0644]
comicsporn/tests.py [new file with mode: 0644]
comicsporn/views.py [new file with mode: 0644]
settings.py

diff --git a/comicsporn/__init__.py b/comicsporn/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/comicsporn/__init__.pyc b/comicsporn/__init__.pyc
new file mode 100644 (file)
index 0000000..6559fb9
Binary files /dev/null and b/comicsporn/__init__.pyc differ
diff --git a/comicsporn/models.py b/comicsporn/models.py
new file mode 100644 (file)
index 0000000..8ccfd9d
--- /dev/null
@@ -0,0 +1,38 @@
+from django.db import models
+
+# Create your models here.
+
+# A very basic data model to begin with
+# Create sensible default option, test the authentification framework, ensure 
+# pertinence of the comics building way : page by page, vignette by vignette, etc. offer 
+# multiple way as much as much possible, test upload to PDF file outisde the DB...
+
+class User(models.Model):
+       first_name = models.CharField(max_length=50)
+       last_name = models.CharField(max_length=50)
+       # Not sure about this two, django should offer login/pass and session
+       #login = models.CharField(max_length=15)
+       #password = models.CharField(max_length=15) 
+       email = models.EmailField()
+       headshot = models.ImageField(upload_to='user_headshots')
+       is_author = models.BooleanField()
+        #num_awards = models.IntegerField()
+
+
+class Comics_page(models.Model):
+       # Not sure about vignette by vignette view or page by page ... let's start page by page 
+       page_number = models.IntegerField()
+       page_content = models.ImageField(upload_to='comics_pages')
+       upload_date = models.DateField()
+       page_authors = models.ManyToManyField(User)
+
+class Comics(Comics_page):
+       title = models.CharField(max_length=300)
+       rating = models.FloatField()
+       authors = models.ManyToManyField(User)
+       publication_date = models.DateField()
+       # Change the related name to a more appropriate name
+       fragment_comics = models.ManyToManyField(Comics_page, related_name="%(app_label)s_%(class)s_related")
+       full_comics = models.ImageField(upload_to='comics_full')
+       full_comics_upload_date = models.DateField()
+       #publisher = models.ForeignKey(User)
diff --git a/comicsporn/models.pyc b/comicsporn/models.pyc
new file mode 100644 (file)
index 0000000..af24cbc
Binary files /dev/null and b/comicsporn/models.pyc differ
diff --git a/comicsporn/tests.py b/comicsporn/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/comicsporn/views.py b/comicsporn/views.py
new file mode 100644 (file)
index 0000000..60f00ef
--- /dev/null
@@ -0,0 +1 @@
+# Create your views here.
index e2dd4a053bc7998e4e50bb6197b37d8bb1bd01ff..cc21cbb053d684bef9e6af372f10dd1f02c33bdc 100644 (file)
@@ -128,6 +128,7 @@ INSTALLED_APPS = (
     'django.contrib.admin',
     # Uncomment the next line to enable admin documentation:
     'django.contrib.admindocs',
+    'comicsporn',
 )
 
 # A sample logging configuration. The only tangible logging