Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Updated docs, updated readme, more tests.

  • Loading branch information...
commit 8f5a421a1783a96557acf7543ab9ea5098db6c27 1 parent 02ed76d
@bartTC authored
View
7 README
@@ -25,6 +25,13 @@ Documenation is available online under:
Changelog
=========
+----------------------------
+v0.9 (backwards compatible):
+----------------------------
+
+* Fixed a bug where an integer was not allowed as a part of a slug.
+
+----------------------------
v0.4 (backwards compatible):
----------------------------
View
2  django_generic_flatblocks/tests/__init__.py
@@ -55,12 +55,14 @@ def testSlugArgument(self):
{% gblock "title","foo" for "gblocks.Title" %}
{% gblock "title","foo",LANGUAGE_CODE for "gblocks.Title" %}
{% gblock "user",user.pk for "gblocks.Title" %}
+ {% gblock "int","slug",1 for "gblocks.Title" %}
'''
self.parseTemplate(template_string)
self.assertTrue(GenericFlatblock.objects.get(slug='title'))
self.assertTrue(GenericFlatblock.objects.get(slug='title_foo'))
self.assertTrue(GenericFlatblock.objects.get(slug='title_foo_en'))
self.assertTrue(GenericFlatblock.objects.get(slug='user_1'))
+ self.assertTrue(GenericFlatblock.objects.get(slug='int_slug_1'))
def testSlugArgumentWithInteger(self):
# Integer slug
View
1  docs/ref/usage.rst
@@ -27,6 +27,7 @@ well. Examples::
"homepage headline" becomes "homepage_headline"
"homepage","headline" becomes "homepage_headline"
"homepage_title",LANGUAGE_CODE becomes "homepage_title_en" (depends on the users locale code)
+ "user",user.pk becomes "user_1" (depends on the primary key of the currently logged in user)
You can pass an *integer* as the slug. This will cause the templatetag to fetch
the model named in *for* with the primary key you named in *slug*. Example::
Please sign in to comment.
Something went wrong with that request. Please try again.