update in django orm

from django.db.models import Q

obj, created = Person.objects.filter(
    Q(first_name='Bob') | Q(first_name='Robert'),
).get_or_create(last_name='Marley', defaults={'first_name': 'Bob'})

Here is what the above code is Doing:
1. It’s creating a query that will return either the first person with the first name ‘Bob’ or the first person with the first name ‘Robert’.
2. It’s then calling get_or_create() on that query, which will either return the first person that matched the query, or create a new person with the last name ‘Marley’ and the first name ‘Bob’.
3. If the person already existed, get_or_create() will return a two-tuple of that person and False. If the person didn’t exist, get_or_create() will return a two-tuple of that person and True.