Skip to content

Commit

Permalink
Added Meta class and db_table to Category.
Browse files Browse the repository at this point in the history
Added tests for db_table.
  • Loading branch information
joost@cassee.net committed Jun 10, 2008
1 parent ceb28e4 commit 9df4e34
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion testproject/articles/models.py
Expand Up @@ -14,6 +14,13 @@
>>> from django.db.models import Q
>>> set_default_language(1)
### Check the table names
>>> Category._meta.translation_model._meta.db_table
'category_language'
>>> Article._meta.translation_model._meta.db_table
'articles_article_translation'
### Create the test data
# Check both assigning via the proxy properties and set_* functions
Expand Down Expand Up @@ -242,10 +249,13 @@ class Translation(multilingual.Translation):
"""

name = models.CharField(verbose_name=_("The name"),
blank=True, null=False, maxlength=250)
maxlength=250)
description = models.TextField(verbose_name=_("The description"),
blank=True, null=False)

class Meta:
db_table = 'category_language'

def get_absolute_url(self):
return "/" + str(self.id) + "/"

Expand Down

0 comments on commit 9df4e34

Please sign in to comment.