Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

get_or_create in django

obj, created = Person.objects.get_or_create(
    first_name='John',
    last_name='Lennon',
    defaults={'birthday': date(1940, 10, 9)},
)
Source by docs.djangoproject.com #
 
PREVIOUS NEXT
Tagged: #django
ADD COMMENT
Topic
Name
4+6 =