Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 #91

Open
etdebruin opened this issue Mar 18, 2016 · 2 comments

Comments

@etdebruin
Copy link

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

@bketelsen
Copy link
Member

fix comes in #118

@jrnt30
Copy link

jrnt30 commented Feb 19, 2017

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()
})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants