gorma icon indicating copy to clipboard operation
gorma copied to clipboard

If you don't mark a field as a PK in the design process, gorma doesn't add the PK flag to the id field from your mediatype that it inherits

Open etdebruin opened this issue 9 years ago • 2 comments

From a slack chat with @bketelsen

gorma doesn’t make you enter all the fields RendersTo() and BuildsFrom() read the fields in the payload and media types and add those to your model but if you already have an “id” field, maybe gorma doesn’t mark it as a PK I can see how this would happen BuildsFrom() is the only one that adds fields RendersTo() causes conversion funcs to be created, but doesn’t add fields so if there’s no “id” in your Payload you wouldn’t get an id in the model, and you’[d have to add it manually it’s a bug

etdebruin avatar Mar 18 '16 21:03 etdebruin

fix comes in #118

bketelsen avatar Jul 19 '16 17:07 bketelsen

This is still an issue with latest. As stated, the associated list/query methods will not have the ID attribute explicitly including without

Field("id", gorma.Integer, func() {
   PrimaryKey()
})

jrnt30 avatar Feb 19 '17 03:02 jrnt30