Following code (1) is to setup idle to try some simple appengine
related stuffs. It was working fine in windows, but not in Linux. I am
getting "BadArgumentError: _app must not be empty.", during model.put.
please check (2). Please let me know if anything is wrong.

First I doubted "datastore_v3", it could be "datastore_v4", or more,
but it is not. :)

(1)
----------
>>> exec('''
import sys
sys.path.append('/home/i/dev/appe/google_appengine')
sys.path.append('/home/i/dev/appe/google_appengine/lib/django')
sys.path.append('/home/i/dev/appe/google_appengine/lib/webob')
sys.path.append('/home/i/dev/appe/google_appengine/lib/yaml/lib')
sys.path.append('/home/i/dev/appe/google_appengine/demos/test')

import time
import os
import string
import random
import logging
from hashlib import sha1
import wsgiref.handlers
from google.appengine.ext.webapp import template
from google.appengine.ext import webapp
from google.appengine.ext import db
from google.appengine.ext.db import TransactionFailedError
from google.appengine.api import users
from google.appengine.api import datastore_file_stub
from google.appengine.api import mail_stub
from google.appengine.api import apiproxy_stub_map
from google.appengine.api import urlfetch_stub
from google.appengine.api import user_service_stub

apiproxy_stub_map.apiproxy = apiproxy_stub_map.APIProxyStubMap()

apiproxy_stub_map.apiproxy.RegisterStub('urlfetch',
    urlfetch_stub.URLFetchServiceStub())
apiproxy_stub_map.apiproxy.RegisterStub('user',
    user_service_stub.UserServiceStub())
apiproxy_stub_map.apiproxy.RegisterStub('datastore_v3',
    datastore_file_stub.DatastoreFileStub('test',
        '/home/i/dev/appe/google_appengine/demos/datastore',
        '/home/i/dev/appe/google_appengine/demos/datastore.history'))
apiproxy_stub_map.apiproxy.RegisterStub('mail',
    mail_stub.MailServiceStub())
''')
----------

(2)
----------
>>> class test(db.Model):
    a = db.StringProperty(required=True)
    b = db.StringProperty(required=True)

>>> test(a='a1:test:x:test', b='b1:test:y:test').put()
Traceback (most recent call last):
  File "<pyshell#5>", line 1, in <module>
    test(a='a1:test:x:test', b='b1:test:y:test').put()
  File "/home/i/dev/appe/google_appengine/google/appengine/ext/db/
__init__.py", line 617, in put
    self._populate_internal_entity()
  File "/home/i/dev/appe/google_appengine/google/appengine/ext/db/
__init__.py", line 599, in _populate_internal_entity
    self._entity = self._populate_entity(_entity_class=_entity_class)
  File "/home/i/dev/appe/google_appengine/google/appengine/ext/db/
__init__.py", line 645, in _populate_entity
    _app=self._app)
  File "/home/i/dev/appe/google_appengine/google/appengine/api/
datastore.py", line 288, in __init__
    _app = datastore_types.ResolveAppId(_app)
  File "/home/i/dev/appe/google_appengine/google/appengine/api/
datastore_types.py", line 120, in ResolveAppId
    ValidateString(app, '_app', datastore_errors.BadArgumentError)
  File "/home/i/dev/appe/google_appengine/google/appengine/api/
datastore_types.py", line 97, in ValidateString
    raise exception('%s must not be empty.' % name)
BadArgumentError: _app must not be empty.
----------

Linux idle is not even reading my PYTHONPATH. :(
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
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