1obj, created = Person.objects.update_or_create(
2 first_name='John', last_name='Lennon',
3 defaults={'first_name': 'Bob'},
4)
5# If person exists with first_name='John' & last_name='Lennon' then update first_name='Bob'
6# Else create new person with first_name='Bob' & last_name='Lennon'
7