示例#1
0
 def blackholeCategory(self):
     try:
         return Category.objects.get(translations__title='BlackHole')
     except Category.DoesNotExist:
         cat = Category()
         cat.save()
         cat.translations.add(CategoryTranslation(title='BlackHole'))
         return cat
示例#2
0
 def blackholeCategory(self):
     try:
         return Category.objects.get(translations__title='BlackHole')
     except Category.DoesNotExist:
         cat = Category()
         cat.save()
         cat.translations.add(CategoryTranslation(title='BlackHole'))
         return cat
示例#3
0
 def _saveCategory(self, title, desc):
     c = Category()
     c.save()
     c.translations.add(CategoryTranslation(title=title, description=desc))
     return c
示例#4
0
 def _saveCategory(self, title, desc):
     c = Category()
     c.save()
     c.translations.add(CategoryTranslation(title=title, description=desc))
     return c