Re: [Modeling-users] primary key + class property
Status: Abandoned
Brought to you by:
sbigaret
From: Sebastien B. <sbi...@us...> - 2003-02-20 21:34:30
|
Yannick Gingras <yan...@sa...> writes: [about PK being class properties NOT being automatically generated] > I had a default value set to 'None' for the primary key of an entity. > It worked perfectly as long as the primary key was not a class > property. When I turned it (the primary key) to a class property, I > was not able to create an object anymore. When saving the changes, > the editing context was complaining about a required field not > initialized. I changed the default value to 0 and it worked. Ok, that makes sense: the validation process was preventing the framework to save the changes, hence the primary key had no chance to get its value. This also rings a bell about one future feature, where you would be able to set the primary key according to your own scheme --in this case, having None or 0 (or even '') would mean ''use automatic PK generation'', while any other value will be used as-is for the PK value, hence bypassing the automatic generation. I'll think of it and keep you informed of the evolution. > Should be in the FAQ ! > ; ) Definitely! Thanks a lot for reporting this. -- S=E9bastien. |