How to mass replace or update values ?

Hi so i am trying to change the wording of my links.

for example i have links ending with .com but want to replace it with .co.uk

how can i do that ? I have done the following but the query set does not have a update method.Please Help

from testing.models import retailer

amazon = retailer.objects.filter(country="UK",shop="Amazon")

amazon.count()
355

final_links = []

for all in amazon:
  final = all.links.replace(".com",".co.uk")
  final_links.append(final)

In [15]: for final,amz in zip(final_links,amazon):
    ...:     amz.update(links = final)
    ...: 
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In [15], line 2
      1 for final,amz in zip(final_links,amazon):
----> 2     amz.update(links = final)

AttributeError: 'retailer' object has no attribute 'update'

A model doesn’t have an update method, but a QuerySet does. (See https://docs.djangoproject.com/en/4.1/ref/models/querysets/#update)

To update an individual instance of a model, make the change to the model attribute and call save on that instance.

Hello,
The easiest way to find and replace multiple entries in Excel is by using the SUBSTITUTE function . The formula’s logic is very simple: you write a few individual functions to replace an old value with a new one.
Your querry will be resolved.