Browse files

Started my version of coltrane, named blurg

  • Loading branch information...
1 parent 3635b9a commit c097e5a58f802305537c438caef51e8c556ea96b @tommeagher committed Jan 21, 2012
View
7 blurg/admin.py
@@ -0,0 +1,7 @@
+from django.contrib import admin
+from blurg.models import Category
+
+class CategoryAdmin(admin.ModelAdmin):
+ prepopulated_fields = {'slug': ['title']}
+
+admin.site.register(Category, CategoryAdmin)
View
18 blurg/models.py
@@ -0,0 +1,18 @@
+from django.db import models
+
+
+
+class Category(models.Model):
+ title = models.CharField(max_length=250, help_text='Maximum 250 characters.')
+ slug = models.SlugField(unique=True, help_text='Suggested value automatically generated from title. Must be unique.')
+ description = models.TextField()
+
+ class Meta:
+ ordering = ['title']
+ verbose_name_plural="Categories"
+
+ def __unicode__(self):
+ return self.title
+
+ def get_absolute_url(self):
+ return "/categories/%s" % self.slug
View
0 blurg/views.py
No changes.
View
BIN cms/cms.db
Binary file not shown.
View
0 manage.py → cms/manage.py
File renamed without changes.
View
2 cms/readme.textile
@@ -0,0 +1,2 @@
+I'm working my way through James Bennett's excellent "Practical Django Projects."
+By the end of it, I hope to have the skeleton for my new sandbox website for a few apps I've been mulling over. Stay tuned.
View
2 search/admin.py → cms/search/admin.py
@@ -2,7 +2,7 @@
from django.contrib.flatpages.admin import FlatPageAdmin
from django.contrib.flatpages.models import FlatPage
-from ultracasual.search.models import SearchKeyword
+from cms.search.models import SearchKeyword
class SearchKeywordInline(admin.StackedInline):
model = SearchKeyword
View
0 fixtures/mydata.json → cms/search/fixtures/initial_data.json
File renamed without changes.
View
1 cms/search/fixtures/mydata.json
@@ -0,0 +1 @@
+[{"pk": 5, "model": "contenttypes.contenttype", "fields": {"model": "contenttype", "name": "content type", "app_label": "contenttypes"}}, {"pk": 9, "model": "contenttypes.contenttype", "fields": {"model": "flatpage", "name": "flat page", "app_label": "flatpages"}}, {"pk": 2, "model": "contenttypes.contenttype", "fields": {"model": "group", "name": "group", "app_label": "auth"}}, {"pk": 8, "model": "contenttypes.contenttype", "fields": {"model": "logentry", "name": "log entry", "app_label": "admin"}}, {"pk": 4, "model": "contenttypes.contenttype", "fields": {"model": "message", "name": "message", "app_label": "auth"}}, {"pk": 1, "model": "contenttypes.contenttype", "fields": {"model": "permission", "name": "permission", "app_label": "auth"}}, {"pk": 10, "model": "contenttypes.contenttype", "fields": {"model": "searchkeyword", "name": "search keyword", "app_label": "search"}}, {"pk": 6, "model": "contenttypes.contenttype", "fields": {"model": "session", "name": "session", "app_label": "sessions"}}, {"pk": 7, "model": "contenttypes.contenttype", "fields": {"model": "site", "name": "site", "app_label": "sites"}}, {"pk": 3, "model": "contenttypes.contenttype", "fields": {"model": "user", "name": "user", "app_label": "auth"}}, {"pk": "6eccff30c8d419232fa1811d76e63009", "model": "sessions.session", "fields": {"expire_date": "2012-02-02 20:19:15", "session_data": "ZWRiZGI4NDY5OTZjNDJmMzViNWUxY2I5N2RmNDdkMmU1YTUwYzNiZTqAAn1xAShVEl9hdXRoX3Vz\nZXJfYmFja2VuZHECVSlkamFuZ28uY29udHJpYi5hdXRoLmJhY2tlbmRzLk1vZGVsQmFja2VuZHED\nVQ1fYXV0aF91c2VyX2lkcQRLAXUu\n"}}, {"pk": 1, "model": "sites.site", "fields": {"domain": "127.0.0.1:8000", "name": "localhost"}}, {"pk": 4, "model": "admin.logentry", "fields": {"action_flag": 1, "action_time": "2012-01-20 21:26:02", "object_repr": "/second-page/ -- My Second Page", "object_id": "2", "change_message": "", "user": 1, "content_type": 9}}, {"pk": 3, "model": "admin.logentry", "fields": {"action_flag": 2, "action_time": "2012-01-20 20:49:50", "object_repr": "/first-page/ -- My first page", "object_id": "1", "change_message": "Changed content. Added search keyword \"Django\". Added search keyword \"Pills\". Added search keyword \"Downtown\". Added search keyword \"Love\".", "user": 1, "content_type": 9}}, {"pk": 2, "model": "admin.logentry", "fields": {"action_flag": 1, "action_time": "2012-01-19 20:22:41", "object_repr": "/first-page/ -- My first page", "object_id": "1", "change_message": "", "user": 1, "content_type": 9}}, {"pk": 1, "model": "admin.logentry", "fields": {"action_flag": 2, "action_time": "2012-01-19 20:21:13", "object_repr": "127.0.0.1:8000", "object_id": "1", "change_message": "Changed domain and name.", "user": 1, "content_type": 7}}, {"pk": 1, "model": "flatpages.flatpage", "fields": {"registration_required": false, "title": "My first page", "url": "/first-page/", "template_name": "", "sites": [1], "content": "<p>This is my first (well, not really) Django flat page.</p>", "enable_comments": false}}, {"pk": 2, "model": "flatpages.flatpage", "fields": {"registration_required": false, "title": "My Second Page", "url": "/second-page/", "template_name": "", "sites": [1], "content": "<p>This is the second page I've made. Can't believe I got that view to work!</p>", "enable_comments": false}}, {"pk": 1, "model": "search.searchkeyword", "fields": {"page": 1, "keyword": "Django"}}, {"pk": 2, "model": "search.searchkeyword", "fields": {"page": 1, "keyword": "Pills"}}, {"pk": 3, "model": "search.searchkeyword", "fields": {"page": 1, "keyword": "Downtown"}}, {"pk": 4, "model": "search.searchkeyword", "fields": {"page": 1, "keyword": "Love"}}, {"pk": 5, "model": "search.searchkeyword", "fields": {"page": 2, "keyword": "Love"}}, {"pk": 6, "model": "search.searchkeyword", "fields": {"page": 2, "keyword": "Dub"}}, {"pk": 7, "model": "search.searchkeyword", "fields": {"page": 2, "keyword": "Reggae"}}, {"pk": 22, "model": "auth.permission", "fields": {"codename": "add_logentry", "name": "Can add log entry", "content_type": 8}}, {"pk": 23, "model": "auth.permission", "fields": {"codename": "change_logentry", "name": "Can change log entry", "content_type": 8}}, {"pk": 24, "model": "auth.permission", "fields": {"codename": "delete_logentry", "name": "Can delete log entry", "content_type": 8}}, {"pk": 4, "model": "auth.permission", "fields": {"codename": "add_group", "name": "Can add group", "content_type": 2}}, {"pk": 5, "model": "auth.permission", "fields": {"codename": "change_group", "name": "Can change group", "content_type": 2}}, {"pk": 6, "model": "auth.permission", "fields": {"codename": "delete_group", "name": "Can delete group", "content_type": 2}}, {"pk": 10, "model": "auth.permission", "fields": {"codename": "add_message", "name": "Can add message", "content_type": 4}}, {"pk": 11, "model": "auth.permission", "fields": {"codename": "change_message", "name": "Can change message", "content_type": 4}}, {"pk": 12, "model": "auth.permission", "fields": {"codename": "delete_message", "name": "Can delete message", "content_type": 4}}, {"pk": 1, "model": "auth.permission", "fields": {"codename": "add_permission", "name": "Can add permission", "content_type": 1}}, {"pk": 2, "model": "auth.permission", "fields": {"codename": "change_permission", "name": "Can change permission", "content_type": 1}}, {"pk": 3, "model": "auth.permission", "fields": {"codename": "delete_permission", "name": "Can delete permission", "content_type": 1}}, {"pk": 7, "model": "auth.permission", "fields": {"codename": "add_user", "name": "Can add user", "content_type": 3}}, {"pk": 8, "model": "auth.permission", "fields": {"codename": "change_user", "name": "Can change user", "content_type": 3}}, {"pk": 9, "model": "auth.permission", "fields": {"codename": "delete_user", "name": "Can delete user", "content_type": 3}}, {"pk": 13, "model": "auth.permission", "fields": {"codename": "add_contenttype", "name": "Can add content type", "content_type": 5}}, {"pk": 14, "model": "auth.permission", "fields": {"codename": "change_contenttype", "name": "Can change content type", "content_type": 5}}, {"pk": 15, "model": "auth.permission", "fields": {"codename": "delete_contenttype", "name": "Can delete content type", "content_type": 5}}, {"pk": 25, "model": "auth.permission", "fields": {"codename": "add_flatpage", "name": "Can add flat page", "content_type": 9}}, {"pk": 26, "model": "auth.permission", "fields": {"codename": "change_flatpage", "name": "Can change flat page", "content_type": 9}}, {"pk": 27, "model": "auth.permission", "fields": {"codename": "delete_flatpage", "name": "Can delete flat page", "content_type": 9}}, {"pk": 28, "model": "auth.permission", "fields": {"codename": "add_searchkeyword", "name": "Can add search keyword", "content_type": 10}}, {"pk": 29, "model": "auth.permission", "fields": {"codename": "change_searchkeyword", "name": "Can change search keyword", "content_type": 10}}, {"pk": 30, "model": "auth.permission", "fields": {"codename": "delete_searchkeyword", "name": "Can delete search keyword", "content_type": 10}}, {"pk": 16, "model": "auth.permission", "fields": {"codename": "add_session", "name": "Can add session", "content_type": 6}}, {"pk": 17, "model": "auth.permission", "fields": {"codename": "change_session", "name": "Can change session", "content_type": 6}}, {"pk": 18, "model": "auth.permission", "fields": {"codename": "delete_session", "name": "Can delete session", "content_type": 6}}, {"pk": 19, "model": "auth.permission", "fields": {"codename": "add_site", "name": "Can add site", "content_type": 7}}, {"pk": 20, "model": "auth.permission", "fields": {"codename": "change_site", "name": "Can change site", "content_type": 7}}, {"pk": 21, "model": "auth.permission", "fields": {"codename": "delete_site", "name": "Can delete site", "content_type": 7}}, {"pk": 1, "model": "auth.user", "fields": {"username": "tom", "first_name": "", "last_name": "", "is_active": true, "is_superuser": true, "is_staff": true, "last_login": "2012-01-19 20:19:15", "groups": [], "user_permissions": [], "password": "sha1$c27ae$fd950921c91f260363788973effe6aec5d3a8dcd", "email": "car+bit@tommeagher.com", "date_joined": "2012-01-19 20:14:55"}}]
View
0 fixtures/mydata.xml → cms/search/fixtures/mydata.xml
File renamed without changes.
View
0 search/models.py → cms/search/models.py
File renamed without changes.
View
0 search/tests.py → cms/search/tests.py
File renamed without changes.
View
0 search/views.py → cms/search/views.py
File renamed without changes.
View
7 settings.py → cms/settings.py
@@ -1,4 +1,4 @@
-# Django settings for ultracasual project.
+# Django settings for CMS project.
DEBUG = False
TEMPLATE_DEBUG = False
@@ -86,7 +86,7 @@
'django.contrib.messages.middleware.MessageMiddleware',
)
-ROOT_URLCONF = 'ultracasual.urls'
+ROOT_URLCONF = 'cms.urls'
INSTALLED_APPS = (
'django.contrib.auth',
@@ -100,7 +100,8 @@
# Uncomment the next line to enable admin documentation:
'django.contrib.admindocs',
'django.contrib.flatpages',
- 'ultracasual.search',
+ 'cms.search',
+ 'blurg',
)
# A sample logging configuration. The only tangible logging
View
0 ...admin/flatpages/flatpage/change_form.html → ...admin/flatpages/flatpage/change_form.html
File renamed without changes.
View
0 templates/flatpages/default.html → cms/templates/flatpages/default.html
File renamed without changes.
View
0 templates/search/list.html → cms/templates/search/list.html
File renamed without changes.
View
0 templates/search/search.html → cms/templates/search/search.html
File renamed without changes.
View
4 urls.py → cms/urls.py
@@ -16,8 +16,8 @@
url(r'^admin/', include(admin.site.urls)),
url(r'^tiny_mce/(?P<path>.*)$', 'django.views.static.serve',
{ 'document_root': '/Users/admin/.virtualenvs/uc/lib/tinymce/jscripts/tiny_mce/'}),
- url(r'^search/$', 'ultracasual.search.views.search'),
- url(r'^list/$', 'ultracasual.search.views.listpages'),
+ url(r'^search/$', 'cms.search.views.search'),
+ url(r'^list/$', 'cms.search.views.listpages'),
url(r'', include('django.contrib.flatpages.urls')),
)
View
3 readme.textile
@@ -1,2 +1,5 @@
I'm working my way through James Bennett's excellent "Practical Django Projects."
By the end of it, I hope to have the skeleton for my new sandbox website for a few apps I've been mulling over. Stay tuned.
+
+The source code for the book lives here, https://bitbucket.org/ubernostrum/practical-django-projects/src . But I imagine my code will differ significantly from it.
+Here's the code of another reader as well: http://www.gyford.com/phil/writing/2010/01/14/django.php

0 comments on commit c097e5a

Please sign in to comment.