Hi martin,

It sounds like at some point in your code, a call to get the key for a model
is made before the model has been put into the datastore. From looking at
the code you've posted so far, I wasn't sure where the exception was being
raised.

You mentioned differences in the case of letters in the key, which I think
would present a problem since the key is base64 encoded which is case
sensitive.

Thank you,

Jeff

On Fri, Jun 5, 2009 at 5:26 PM, martin <[email protected]> wrote:

>
> Hi, I have a bit of a problem with my page at the moment, I'm quite
> new to python/GAE/web dev so hopefully it's something silly and easy
> to solve ;)
>
> First of all, I have this method:
>
> class AttachFile(webapp.RequestHandler):
>  def post(self):
>    entry = blobclasses.BlobFile()
>    #fill the entry with useful data
>    key = entry.put()
>
>    project = repositoryclasses.FileRepositoryCollection.get(db.Key
> (self.request.query_string))
>    project.containedFiles.append(key)
>    project.put()
>
>    self.redirect('/repository/listallfiles?' +
> self.request.query_string)
>
> the FileRepositoryCollection looks like this:
>
> class FileRepositoryCollection(db.Model):
>  containedFiles = db.ListProperty(db.Key)
>  #other data
>
> So, Contained files should contain a list of all blob files which have
> been added through this method, however when I try and do this:
>
> project = repositoryclasses.FileRepositoryCollection.get(db.Key
> (self.request.query_string))
> files = []
> for key in project.containedFiles:
>  files.append(blobclasses.BlobFile(key))
>
> I get a NotSavedError! I tried outputting that key as str(key) and the
> letters and numbers are the same but the capitalisation is different -
> which I guess is the proble, but I certainly don't understand the
> cause!
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to