From c8070854bc39b679b53502dd08eb9b8e33477e42 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Thu, 31 Oct 2013 00:40:54 +0100 Subject: [PATCH] The comicsporn django app : the beginning. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- comicsporn/__init__.py | 0 comicsporn/__init__.pyc | Bin 0 -> 142 bytes comicsporn/models.py | 38 ++++++++++++++++++++++++++++++++++++++ comicsporn/models.pyc | Bin 0 -> 1630 bytes comicsporn/tests.py | 16 ++++++++++++++++ comicsporn/views.py | 1 + settings.py | 1 + 7 files changed, 56 insertions(+) create mode 100644 comicsporn/__init__.py create mode 100644 comicsporn/__init__.pyc create mode 100644 comicsporn/models.py create mode 100644 comicsporn/models.pyc create mode 100644 comicsporn/tests.py create mode 100644 comicsporn/views.py diff --git a/comicsporn/__init__.py b/comicsporn/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/comicsporn/__init__.pyc b/comicsporn/__init__.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6559fb98d7b040472b3d7b3e72130d284ad548ce GIT binary patch literal 142 zcmZSn%*z$nRTz}a00oRd+5w1*S%5?e14FO|NW@PANHCxg#pXaU{fzwFRQ zRQ=+jWc`$^#Ju$U^8BJ~-So^7{p9@I%;e&N{GvSl`1s7c%#!$cy@JXT4xnC}-29Z% NoK!oI4aGpr001_DA3Xp7 literal 0 HcmV?d00001 diff --git a/comicsporn/models.py b/comicsporn/models.py new file mode 100644 index 0000000..8ccfd9d --- /dev/null +++ b/comicsporn/models.py @@ -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 index 0000000000000000000000000000000000000000..af24cbc13c062fc0c610ef08a808207fd401017b GIT binary patch literal 1630 zcmb_c&2H2%5VrTfZTdr{g7$zoRSFVxB_wVLK?{|7D2Eh~SRq;7*qcpp;t+cUJ(q{z z@puOw0A|M7pOzzCHB--cY=8c~8Ml9LZ~prEHAz|XYs3Fn@VU=m6#Q{!7%Mm%bH-JR zY0fTNY|5ExvmcCIGxllRW~#F`(Oph-nCdazq4fST+GT3MF5(S1ApZlun8V2Tz!X+# z<9r8(ADpglfI5bt`v^ue#G+g563!)n*Nl$=z^zD^B0YpS?$da{-~xaf^EW86NwZrl zxrp&lzX_(0--Xd-=4bgcj3Lf>Wvo=fTfc)IU=uSfm77`b;s~<_V1y`Tp@pDrgn--3 z4Y&zRg>6n|vOdkVQIs*wYv*YRonhp{LlkcdnVXQ?1y`d>tIi6U=`ew3E?{^>acr&8 zvJA7tuM=|aXSR-EmaU9?4(@1X3q6|FGRuq}xjG%GOIc?2o2|b*&2m3VZIP$0vUNEM z${bZ!35taP9hx5B=lh)qtlt9ngcgVj5dN#(Ye-nv4s{8tK|w5agn9uT`=rZ&#-J3) z1O-SkwP2T|4Tdfp5YmA`hXlz=u$BVr$jVvib*3BQ5hmgj<-C~aIwA4UP%yQSTYA#t zjr0xAxTdK91wp?H{<$o#-dnW9HqkYHffwMYZl8!PH?at4bI-(dMxehj9wU?_ks<27!_GM&Rk(nD`#}xAaZ=5c87l_TjXuc%u0(FD`NZTYq}o!T#t8;VXzY&yYC;4k zpr}R(hmX`GGyrmQj?XGx dp01VPMt25_UcMLMt$T?CJ7j%tV;Bwle*q11Wb6O{ literal 0 HcmV?d00001 diff --git a/comicsporn/tests.py b/comicsporn/tests.py new file mode 100644 index 0000000..501deb7 --- /dev/null +++ b/comicsporn/tests.py @@ -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 index 0000000..60f00ef --- /dev/null +++ b/comicsporn/views.py @@ -0,0 +1 @@ +# Create your views here. diff --git a/settings.py b/settings.py index e2dd4a0..cc21cbb 100644 --- a/settings.py +++ b/settings.py @@ -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 -- 2.34.1