Python problem with circular reference?

You're trying to import from image_blob. Py before the entirety of image. Py is processed.At the time which the from app.models.

Item import Item occurs class Image hasn't yet been defined, and thus can't yet be imported (the entire class definition must have been processed before the symbol is actually defined) There's a simple solution to this: Don't define the image property on ImageBlob AppEngine's models automatically define a backwards reference for you, so when you add the ImageBlob to the Image it'll automatically define a property on the ImageBlob which references back to the set of Image s which reference it (which, in your current use case, should be of size 1).

You're trying to import from image_blob. Py before the entirety of image. Py is processed.At the time which the from app.models.

Item import Item occurs, class Image hasn't yet been defined, and thus can't yet be imported (the entire class definition must have been processed before the symbol is actually defined). There's a simple solution to this: Don't define the image property on ImageBlob. AppEngine's models automatically define a backwards reference for you, so when you add the ImageBlob to the Image, it'll automatically define a property on the ImageBlob which references back to the set of Images which reference it (which, in your current use case, should be of size 1).

The backwards reference is simply a query against the referencing property for itself. I agree to not create refs in both directions. – kevpie Oct 31 '10 at 23:13 thanks!

That resolved the problem! – Totty Nov 12 '10 at 18:16.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions