changeset 2:3cef0d445036

Start actual app structure
author Jordi Gutiérrez Hermoso <jordigh@gmail.com>
date Fri, 25 Jun 2010 10:03:51 -0500
parents 013cf0aa49b7
children 9a4429652662
files apps/bundle/__init__.py apps/bundle/models.py apps/bundle/tests.py apps/bundle/views.py apps/free_license/__init__.py apps/free_license/models.py apps/free_license/tests.py apps/free_license/views.py apps/snippet/__init__.py apps/snippet/models.py apps/snippet/tests.py apps/snippet/views.py mippet/__init__.py mippet/admin.py mippet/models.py mippet/tests.py mippet/views.py urls.py
diffstat 14 files changed, 88 insertions(+), 58 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/apps/bundle/models.py	Fri Jun 25 10:03:51 2010 -0500
@@ -0,0 +1,3 @@
+from django.db import models
+
+# Create your models here.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/apps/bundle/tests.py	Fri Jun 25 10:03:51 2010 -0500
@@ -0,0 +1,23 @@
+"""
+This file demonstrates two different styles of tests (one doctest and one
+unittest). These will both pass when you run "manage.py test".
+
+Replace these 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.failUnlessEqual(1 + 1, 2)
+
+__test__ = {"doctest": """
+Another way to test that 1 + 1 is equal to 2.
+
+>>> 1 + 1 == 2
+True
+"""}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/apps/bundle/views.py	Fri Jun 25 10:03:51 2010 -0500
@@ -0,0 +1,1 @@
+# Create your views here.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/apps/free_license/models.py	Fri Jun 25 10:03:51 2010 -0500
@@ -0,0 +1,3 @@
+from django.db import models
+
+# Create your models here.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/apps/free_license/tests.py	Fri Jun 25 10:03:51 2010 -0500
@@ -0,0 +1,23 @@
+"""
+This file demonstrates two different styles of tests (one doctest and one
+unittest). These will both pass when you run "manage.py test".
+
+Replace these 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.failUnlessEqual(1 + 1, 2)
+
+__test__ = {"doctest": """
+Another way to test that 1 + 1 is equal to 2.
+
+>>> 1 + 1 == 2
+True
+"""}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/apps/free_license/views.py	Fri Jun 25 10:03:51 2010 -0500
@@ -0,0 +1,1 @@
+# Create your views here.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/apps/snippet/models.py	Fri Jun 25 10:03:51 2010 -0500
@@ -0,0 +1,3 @@
+from django.db import models
+
+# Create your models here.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/apps/snippet/tests.py	Fri Jun 25 10:03:51 2010 -0500
@@ -0,0 +1,23 @@
+"""
+This file demonstrates two different styles of tests (one doctest and one
+unittest). These will both pass when you run "manage.py test".
+
+Replace these 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.failUnlessEqual(1 + 1, 2)
+
+__test__ = {"doctest": """
+Another way to test that 1 + 1 is equal to 2.
+
+>>> 1 + 1 == 2
+True
+"""}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/apps/snippet/views.py	Fri Jun 25 10:03:51 2010 -0500
@@ -0,0 +1,1 @@
+# Create your views here.
--- a/mippet/admin.py	Thu Jun 24 08:59:14 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-from agora.mippet.models import *
-from django.contrib import admin
-
-admin.site.register(mscript)
-admin.site.register(free_license)
-admin.site.register(bundle)
--- a/mippet/models.py	Thu Jun 24 08:59:14 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-from django.db import models
-
-# Create your models here.
-
-class free_license(models.Model):
-    name = models.CharField(max_length=200)
-    desc = models.TextField()
-    text = models.TextField()
-    gpl_compatible = models.BooleanField()
-    def __unicode__(self):
-        return self.name
-    
-
-class mscript(models.Model):
-    name = models.CharField(max_length=512)
-    code = models.TextField()
-    free_license = models.ForeignKey(free_license)
-    underlying_file = models.FileField(upload_to="var/")
-    is_standalone = models.BooleanField()
-    def __unicode__(self):
-        return self(name)
-
-class bundle(models.Model):
-    name = models.CharField(max_length=512)
-    script = mscript()
-    def __unicode__(self):
-        return self(name)
--- a/mippet/tests.py	Thu Jun 24 08:59:14 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +0,0 @@
-"""
-This file demonstrates two different styles of tests (one doctest and one
-unittest). These will both pass when you run "manage.py test".
-
-Replace these 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.failUnlessEqual(1 + 1, 2)
-
-__test__ = {"doctest": """
-Another way to test that 1 + 1 is equal to 2.
-
->>> 1 + 1 == 2
-True
-"""}
-
--- a/mippet/views.py	Thu Jun 24 08:59:14 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-# Create your views here.
--- a/urls.py	Thu Jun 24 08:59:14 2010 -0500
+++ b/urls.py	Fri Jun 25 10:03:51 2010 -0500
@@ -6,10 +6,16 @@
 
 urlpatterns = patterns('',
 
-    (r'^$', 'django.views.generic.simple.direct_to_template', {'template': 'index.html'}),
+    (r'^$',
+     'django.views.generic.simple.direct_to_template',
+     {'template': 'index.html'}),
     # Example:
     # (r'^agora/', include('agora.foo.urls')),
 
+    #(r'^mippets/$', 'agora.mippet.views.index'),
+   
+    #(r'^mippets/(?P<name>.*)/$', 'agora.mippet.views.detail'),
+
     # Uncomment the admin/doc line below and add 'django.contrib.admindocs' 
     # to INSTALLED_APPS to enable admin documentation:
     (r'^admin/doc/', include('django.contrib.admindocs.urls')),