나는 애플 리케이션 엔진에 익숙하지 않고 두 종류의 링크를 둘러싼 내 머리를 맞기 위해 노력하고 있는데, 문서를 읽은 후에도 여전히 내가 생각하는 관계 데이터베이스 모델에서 너무 많이 접근하고있다.링크 종류 Google App Engine (Python을 사용)
난 내가 함께 두 클래스를 연결 어떻게 사용자가 여러 책
class Book(ndb.Model):
author = ndb.StringProperty(required=True)
booktitle = ndb.StringProperty(required=True)
을 가질 수 있도록 책 클래스를 갖고 싶어
class UserInformation(ndb.Model):
username = ndb.UserProperty()
firstname = ndb.StringProperty(required=True)
lastname = ndb.StringProperty(required=True)
telephone = ndb.IntegerProperty()
email = ndb.StringProperty()
다음 UserInformation 클래스가있는 경우 부모/자식 관계? 그것은 무엇입니까
b = Book(parent=UserInformation, key=’some key’, author=’some author’, booktitle=’a great book’)
그렇다면 어떻게 추출합니까? 신분증을받을 수 있습니다
Users = UserInformation(UserInformation.username==’some user’).get()
User_key = Users.key.id()
하지만 열쇠를 얻을 수없는 것 같습니까? 그것이 소유 관계는 다음 전략은 괜찮 경우
어떤 도움을 기꺼이
사용 ndb.KeyProperty 여러분의 도움과 내가 키 다시 가져올 수 있지만 함께 종류를 연결하기 위해 고군분투하고있는 추가 아이디어 – voscausa