{"action":"closed","issue":{"url":"https://api.github.com/repos/manyminds/api2go/issues/282","repository_url":"https://api.github.com/repos/manyminds/api2go","labels_url":"https://api.github.com/repos/manyminds/api2go/issues/282/labels{/name}","comments_url":"https://api.github.com/repos/manyminds/api2go/issues/282/comments","events_url":"https://api.github.com/repos/manyminds/api2go/issues/282/events","html_url":"https://github.com/manyminds/api2go/issues/282","id":208658401,"number":282,"title":"question: toOne","user":{"login":"dalu","id":2694548,"avatar_url":"https://avatars.githubusercontent.com/u/2694548?v=3","gravatar_id":"","url":"https://api.github.com/users/dalu","html_url":"https://github.com/dalu","followers_url":"https://api.github.com/users/dalu/followers","following_url":"https://api.github.com/users/dalu/following{/other_user}","gists_url":"https://api.github.com/users/dalu/gists{/gist_id}","starred_url":"https://api.github.com/users/dalu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dalu/subscriptions","organizations_url":"https://api.github.com/users/dalu/orgs","repos_url":"https://api.github.com/users/dalu/repos","events_url":"https://api.github.com/users/dalu/events{/privacy}","received_events_url":"https://api.github.com/users/dalu/received_events","type":"User","site_admin":false},"labels":[{"id":123562489,"url":"https://api.github.com/repos/manyminds/api2go/labels/question","name":"question","color":"cc317c","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2017-02-18T18:01:27Z","updated_at":"2017-02-19T13:00:11Z","closed_at":"2017-02-19T13:00:11Z","body":"my javababble and sql relationship terminology is a bit rusty as I've just worked with mongo for a while.\r\nSo I have a question about those relationships and an example.\r\n\r\nI'm trying to write a simple testprogram using api2go.\r\n\r\nThe models look like:\r\n```go\r\ntype Post struct {\r\n\tID    string `bson:\"_id\" json:\"id\"`\r\n\tTitle string `bson:\"title\" json:\"title\"`\r\n\tText  string `bson:\"text\" json:\"text\"`\r\n}\r\n\r\nfunc (p *Post) SetID(string) error {\r\n\tpanic(\"implement me\")\r\n}\r\n\r\nfunc (p Post) GetID() string {\r\n\tpanic(\"implement me\")\r\n}\r\n\r\ntype Comment struct {\r\n\tID     string `bson:\"_id\" json:\"id\"`\r\n\tPostID string `bson:\"post_id\" json:\"post_id\"`\r\n\tAuthor string `bson:\"author\" json:\"author\"`\r\n\tText   string `bson:\"text\" json:\"text\"`\r\n}\r\n```\r\n\r\nSo I have a PostID field on the Comment struct.\r\nI do **not** want to have a commentIDs slice on the Post struct.\r\nIs this possible with api2go? Which interfaces do I have to implement and where?\r\n\r\n\r\nAlso in the example app with user and chocolate, there's\r\n```go\r\nfunc (u User) GetID() string {}\r\nfunc (u *User) SetID(string) error {}\r\n```\r\nThe SetID func has a pointer to User, but the GetID func doesn't.\r\nWhy is that, or rather can I just make all methods refer to a *Post/*User instead of this pointer no-pointer thing?\r\n"}}
{"actor":{"display_login":"dalu"}}