diff --git a/sample/settings.py b/sample/settings.py index 958c3d9..446d8d6 100644 --- a/sample/settings.py +++ b/sample/settings.py @@ -83,6 +83,7 @@ INSTALLED_APPS = ( 'categories', 'editor', 'mptt', + 'simpletext', ) EDITOR_MEDIA_PATH = '/static/editor/' CATEGORIES_ALLOW_SLUG_CHANGE = True \ No newline at end of file diff --git a/sample/simpletext/__init__.py b/sample/simpletext/__init__.py new file mode 100755 index 0000000..e69de29 diff --git a/sample/simpletext/admin.py b/sample/simpletext/admin.py new file mode 100644 index 0000000..e36aadb --- /dev/null +++ b/sample/simpletext/admin.py @@ -0,0 +1,4 @@ +from models import SimpleText +from django.contrib import admin + +admin.site.register(SimpleText) \ No newline at end of file diff --git a/sample/simpletext/models.py b/sample/simpletext/models.py new file mode 100755 index 0000000..7b3d6a0 --- /dev/null +++ b/sample/simpletext/models.py @@ -0,0 +1,31 @@ +from django.db import models + +# Create your models here. + +class SimpleText(models.Model): + """ + (SimpleText description) + """ + + name = models.CharField(max_length=255) + description = models.TextField(blank=True) + created = models.DateTimeField(auto_now_add=True) + updated = models.DateTimeField(auto_now=True) + + class Meta: + verbose_name_plural = 'Simple Text' + ordering = ('-created',) + + def __unicode__(self): + return self.name + + # If using the get_absolute_url method, put the following line at the top of this file: + from django.db.models import permalink + + @permalink + def get_absolute_url(self): + return ('simpletext_detail_view_name', [str(self.id)]) + +import categories +categories.register_fk(SimpleText, 'primary_category', {'related_name':'simpletext_primary_set'}) +categories.register_m2m(SimpleText, 'cats') \ No newline at end of file diff --git a/sample/simpletext/tests.py b/sample/simpletext/tests.py new file mode 100755 index 0000000..2247054 --- /dev/null +++ b/sample/simpletext/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 +"""} + diff --git a/sample/simpletext/views.py b/sample/simpletext/views.py new file mode 100755 index 0000000..60f00ef --- /dev/null +++ b/sample/simpletext/views.py @@ -0,0 +1 @@ +# Create your views here.