Insert Many\Upsert (PostgreSQL) doesn't work with M2M relations
How is an upsert supposed to work across multiple tables? I think you do not understand how many-to-many actually works -- there is a junction table. There is no such thing as website.regions - that information is stored in the through table.
Hello everyone,

Trying to utilize an upsert along with an insert_many query for a model with m2m relation. 

The error I get is `'ManyToManyField' object has no attribute '_sort_key'`


The code example is provided below. Trying to figure out if this is expected behavior due to the fact that ManyToManyField is not a usual peewee field in the default sense or if it's a bug.

```
class Region(_BaseModel):
    name = pw.CharField(unique=True)


class Website(_BaseModel):
    name = pw.CharField()
    url = pw.CharField(unique=True)
    regions = pw.ManyToManyField(Region, backref='websites')

WebsiteRegion = Website.regions.get_through_model()
```

(_Base model has a UUID4 id assigned to it)

However, when I'm trying to use an upsert which was implemented before M2M relation was added to Website Model and worked just fine, I get the error listed above ('ManyToManyField' object has no attribute '_sort_key')


The upsert setup:

```
query = Website.insert_many(self.data).returning(*self.__RETURNING).on_conflict(
             conflict_target=[Website.url],
             preserve=[Website.url],
             update={
                 Website.name: EXCLUDED.name,
                 Website.regions: EXCLUDED.regions,
                     }
                 )
```

where self.data is a valid list of pydantic models converted to dicts and self.__RETURNING is a valid list of `Website` model attributes desired to be returned.

Perhaps I am missing something required for m2m to work in the upsert?

I already have a workaround utilizing a loop with `website = Website.create(<data>)` and a default `website.regions.add(regions: List[UUID])` for populating m2m, but still having a working upsert for m2m would be great if possible, as create and update in a loop is less efficient than an upsert.


Anyone faced a similar issue with upsert and m2m before and what were your solutions \ workarounds?
Appreciate your time!
