get_or_create

1
2
3
4
5
# get_or_create
a1, created = Article.objects.get_or_create(headline='John', defaults={'day': date(1940, 10, 9)})
# created equals True if record is created and False if it was found