Thanks for this package, it looks like it could be very useful!
I've hit an issue with the DO NOTHING handling -- it assumes that a field called id exists on the model, though this isn't always the case.
class Foo(PostgresModel):
user = models.OneToOneField(User, primary_key=True)
This results in a table with a primary key field called user_id,
It looks like the error stems from the way that the returning data is captured in the compilers' _rewrite_insert_nothing method which uses a literal id in the query construction.