Mercurial > hg > agora-ahsan
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 | 18 files changed, 88 insertions(+), 58 deletions(-) [+] |
line wrap: on
line diff
new file mode 100644 --- /dev/null +++ b/apps/bundle/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here.
new file mode 100644 --- /dev/null +++ b/apps/bundle/tests.py @@ -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 +"""} +
new file mode 100644 --- /dev/null +++ b/apps/bundle/views.py @@ -0,0 +1,1 @@ +# Create your views here.
new file mode 100644 --- /dev/null +++ b/apps/free_license/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here.
new file mode 100644 --- /dev/null +++ b/apps/free_license/tests.py @@ -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 +"""} +
new file mode 100644 --- /dev/null +++ b/apps/free_license/views.py @@ -0,0 +1,1 @@ +# Create your views here.
new file mode 100644 --- /dev/null +++ b/apps/snippet/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here.
new file mode 100644 --- /dev/null +++ b/apps/snippet/tests.py @@ -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 +"""} +
new file mode 100644 --- /dev/null +++ b/apps/snippet/views.py @@ -0,0 +1,1 @@ +# Create your views here.
deleted file mode 100644 --- a/mippet/admin.py +++ /dev/null @@ -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)
deleted file mode 100644 --- a/mippet/models.py +++ /dev/null @@ -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)
deleted file mode 100644 --- a/mippet/tests.py +++ /dev/null @@ -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 -"""} -
deleted file mode 100644 --- a/mippet/views.py +++ /dev/null @@ -1,1 +0,0 @@ -# Create your views here.
--- a/urls.py +++ b/urls.py @@ -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')),