When using pony orm, if primary key is a composite key and one of the key contains postgresql identity column then pony ORM shows error
There is a good reason for me to use a composite key as a primary key instead of just the identity column, and it has to be a composite key
Errors
None type Object not iterable
If obj._pk_is_composite_: pairs = izip(pk_attrs, pkval)
MOdel
id = Required(int, auto=True)
clubname = Required(str)
PrimaryKey(clubname,id)
Table
id integer NOT NULL GENERATED ALWAYS AS IDENTITY,
clubname character varying(128),
CONSTRAINT abc PRIMARY KEY(clubname,id)
There is no good for having a composite Primary Key with one component is auto generated. I think what you are trying to say is that
clubnameshould be unique, if so your composite key does not accomplish that as (clubname,id) values ('A',1) and ('A',2) satisfy your composite key. Instead just create a unique constraint onclubnameitself.