Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def create_entry(self):
entry = Entry.objects.create(
published=True,
title='Something',
slug='something',
language='en')
entry.rawcontent_set.create(
region='main',
ordering=0,
text='Something awful')
return entry
def create_entries(self):
entry = self.create_entry()
Entry.objects.create(
published=True,
title='Something 2',
slug='something-2',
language='de',
translation_of=entry)
Entry.objects.create(
published=True,
title='Something 3',
slug='something-3',
language='de')
def create_entry(self):
entry = Entry.objects.create(
published=True,
title='Something',
slug='something',
language='en')
entry.rawcontent_set.create(
region='main',
ordering=0,
text='Something awful')
return entry
def create_entries(self):
entry = self.create_entry()
Entry.objects.create(
published=True,
title='Something 2',
slug='something-2',
language='de',
translation_of=entry)
Entry.objects.create(
published=True,
title='Something 3',
slug='something-3',
language='de')