```
file = open('debug.txt', 'w')
db_objects = model.objects.all()

    for i in db_objects:
        db_filtered = model.objects.filter(input_address_db=i.input_address_db)
        f.write('filtered_results = %s' % db_filtered)
        ...perform operations...

```

here is the output of the file after the first cycle:

```
db_filtered = [<model: model object>, <model: model object>, <model: model object>, <model: model object>]

```

I checked ahead though and know that there should be only three but as you can see the debug text shows four.

Two of the above objects are the same one duplicated. I know this because I get an integrity error when I try to transfer the four objects into a new database.

The created\_on dates are the primary key so it's also surprising to see the same result twice because I thought an error would be thrown, I now realise that perhaps you might want the same objects repeated in a queryset which is why there is no error but sill I'm having a bit of trouble getting my head around what is actually going on here.

Thanks in advance for any help, it's much appreciated :)