Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
137 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,5 @@ recursive-include $$$$PKG_NAME$$$$/templates * | |
include LICENSE | ||
include README | ||
include *.txt | ||
|
||
prune example/ |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
=============== | ||
Model Reference | ||
=============== | ||
|
||
ModelName | ||
========= | ||
|
||
.. py:class:: ModelName | ||
.. py:attribute:: parent | ||
:py:class:`TreeForeignKey` ``(self)`` | ||
|
||
The category's parent category. Leave this blank for an root category. | ||
|
||
.. py:attribute:: name | ||
**Required** ``CharField(100)`` | ||
|
||
The name of the category. | ||
|
||
.. py:attribute:: slug | ||
**Required** ``SlugField`` | ||
|
||
URL-friendly title. It is automatically generated from the title. | ||
|
||
.. py:attribute:: active | ||
**Required** ``BooleanField`` *default:* ``True`` | ||
|
||
Is this item active. If it is inactive, all children are set to inactive as well. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
|
||
======== | ||
Settings | ||
======== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from django.contrib import admin | ||
|
||
from .models import SimpleModel | ||
|
||
class SimpleModelAdmin(admin.ModelAdmin): | ||
list_display = ('name', ) | ||
prepopulated_fields = {'slug': ('name',)} | ||
search_fields = ('name',) | ||
|
||
admin.site.register(SimpleModel, SimpleModelAdmin) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from django.db import models | ||
|
||
class SimpleModel(models.Model): | ||
""" | ||
(SimpleModel description) | ||
""" | ||
|
||
name = models.CharField(max_length=255) | ||
slug = models.SlugField(unique=True) | ||
description = models.TextField(blank=True) | ||
created = models.DateTimeField(auto_now_add=True) | ||
updated = models.DateTimeField(auto_now=True) | ||
|
||
def __unicode__(self): | ||
return self.name | ||
|
||
@models.permalink | ||
def get_absolute_url(self): | ||
return ('simplemodel_detail_view_name', [str(self.id)]) | ||
|
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from django.conf.urls.defaults import * | ||
|
||
from .models import SimpleModel | ||
|
||
urlpatterns = patterns('django.views.generic.list_detail', | ||
url(r'^$', 'object_list', { | ||
'queryset': SimpleModel.objects.all(), | ||
}, name="simplemodel_list"), | ||
(r'^(?P<slug>[\w-]+)/', 'object_detail', { | ||
'queryset': SimpleModel.objects.all(), | ||
}, name="simplemodel_detail") | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" | ||
"http://www.w3.org/TR/html4/loose.dtd"> | ||
<html lang="en"> | ||
<head> | ||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | ||
<title>$$$$APP_NAME$$$$</title> | ||
</head> | ||
<body> | ||
{% block content %} | ||
{% endblock %} | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters