django orm update code example
Example 1: bulk create django
bulk_create(objs, batch_size = None, ignore_conflicts = False)
Entry.objects.bulk_create([
... Entry(headline='This is a test'),
... Entry(headline='This is only a test'),
... ])
Example 2: django delete object
SomeModel.objects.filter(id=id).delete()
Example 3: django filter values with OR operator
Blog.objects.filter(pk__in=[1, 4, 7])
Example 4: how to work with django ornm __in
>>> Blog.objects.filter(pk__in=[1,4,7])
>>> Blog.objects.filter(pk__gt=14)