Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #16 from dmedvinsky/patch-1

Fix indentation in example code block
  • Loading branch information...
commit 1d1dbd21d0d7a29ac01fd2d8f96f884d18707ed5 2 parents 16c8182 + 24fbb7a
@fivethreeo authored
Showing with 13 additions and 13 deletions.
  1. +13 −13 docs/index.rst
View
26 docs/index.rst
@@ -39,20 +39,20 @@ There are six steps for using simple-translation:
title = models.CharField(max_length=255)
slug = models.SlugField()
- class Meta:
- unique_together = ('language, 'slug')
+ class Meta:
+ unique_together = ('language, 'slug')
- def _get_absolute_url(self):
- language_namespace = \
- 'simple_translation.middleware.MultilingualGenericsMiddleware' in settings.MIDDLEWARE_CLASSES \
- and '%s:' % self.language or ''
- return ('%sentry_detail' % language_namespace, (), {
- 'year': self.entry.pub_date.strftime('%Y'),
- 'month': self.entry.pub_date.strftime('%m'),
- 'day': self.entry.pub_date.strftime('%d'),
- 'slug': self.slug
- })
- get_absolute_url = models.permalink(_get_absolute_url)
+ def _get_absolute_url(self):
+ language_namespace = \
+ 'simple_translation.middleware.MultilingualGenericsMiddleware' in settings.MIDDLEWARE_CLASSES \
+ and '%s:' % self.language or ''
+ return ('%sentry_detail' % language_namespace, (), {
+ 'year': self.entry.pub_date.strftime('%Y'),
+ 'month': self.entry.pub_date.strftime('%m'),
+ 'day': self.entry.pub_date.strftime('%d'),
+ 'slug': self.slug
+ })
+ get_absolute_url = models.permalink(_get_absolute_url)
3. For the models to be translatable, create a ``simple_translate.py`` file
where you register the translated model in the translation_pool. ::
Please sign in to comment.
Something went wrong with that request. Please try again.