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
def _saveCategory(self, title, desc): c = Category() c.save() c.translations.add(CategoryTranslation(title=title, description=desc)) return c