Re: [Modeling-users] self.getId()
Status: Abandoned
Brought to you by:
sbigaret
|
From: <so...@la...> - 2003-03-17 23:49:58
|
On Tue, Mar 18, 2003 at 12:33:32AM +0000, Sebastien Bigaret wrote:
>
> so...@la... wrote:
> > On Mon, Mar 17, 2003 at 07:24:04PM +0100, so...@la... wrote:
>
>
> That is really strange. I just made the very same thing with one of the
> framework's testPackage and everything seems all right:
>
> >>> from Modeling.EditingContext import EditingContext
> >>> from Modeling.FetchSpecification import FetchSpecification
> >>> from testPackages.AuthorBooks.Book import Book
> >>> b=Book()
> >>> b.setTitle('blah')
> >>> ec=EditingContext()
> >>> ec.insertObject(b)
> >>> ec.saveChanges()
> >>> ec.globalIDForObject(b).keyValues()['id']
> 63L
>
>
> ...wait... Oh, ok, now I see:
>
> >>> from Modeling.EditingContext import EditingContext
> >>> from Modeling.FetchSpecification import FetchSpecification
> >>> from testPackages.AuthorBooks.Book import Book
> >>> b=Book()
> >>> b.setTitle('blah')
> >>> ec=EditingContext()
> >>> ec.insertObject(b)
> >>> ec.saveChanges()
> >>> ec.globalIDForObject(b).keyValues()['id']
> 64L
> >>> b._id
> 0
>
> You are using getId() (returning article._id) instead of getID()
> (returning the PK value stored in its GlobalID) !
>
>
> However, we have a bug here: Article's PK did not get its value.
Yeah you got it :)
If don't use the id as classProperty as said in the doc, and use
the getID() helper sent before on the list it works well :)
I guess I win one more point in my debugging level :)
|