google-app-engine

Got Null when querying datastore by key

拟墨画扇 提交于 2020-01-03 18:56:30
问题 I have two models, Book and Chapter, in a one-to-many relationship. I manually create the keys for both Book and Chapter. To persist, I create a book object then add an instance of chapter to it and then persist book. This works fine, as I see them in the datastore. Now when I try to fetch a chapter from the datastore by key, I get a null object. Here is how the keys look in the datastore: Under Book: name/id = 123 chapters = [Book(123)/Chapter("abc")] Under Chapter: name/id = abc I created

App engine - check to see if a property exists within Expando class

耗尽温柔 提交于 2020-01-03 18:50:18
问题 What is a good way to check to see if a property is populated in an expando class (Python for App Engine) Can I do: if Expando_class_name.property_name_to_check: do = someStuff Or is that going to give me an error? Thanks! 回答1: Use hasattr : if hasattr(expando_instance, 'foo'): # Do something with expando_instance.foo 回答2: A better way is to use the dynamic_properties method. if 'foo' in entity.dynamic_properties(): pass 来源: https://stackoverflow.com/questions/6339032/app-engine-check-to-see

Why does manage.py syncdb fail to connect to google cloud sql database?

对着背影说爱祢 提交于 2020-01-03 17:12:39
问题 During a recent update of an app on Google App Engine I was in the process of updating the database with: SETTINGS_MODE='prod' ./manage.py syncdb This worked last time I ran it, but now I am getting the following error: Traceback (most recent call last): File "./manage.py", line 10, in <module> execute_from_command_line(sys.argv) File "/Library/Python/2.7/site-packages/django/core/management/__init__.py", line 399, in execute_from_command_line utility.execute() File "/Library/Python/2.7/site

Why does manage.py syncdb fail to connect to google cloud sql database?

﹥>﹥吖頭↗ 提交于 2020-01-03 17:12:08
问题 During a recent update of an app on Google App Engine I was in the process of updating the database with: SETTINGS_MODE='prod' ./manage.py syncdb This worked last time I ran it, but now I am getting the following error: Traceback (most recent call last): File "./manage.py", line 10, in <module> execute_from_command_line(sys.argv) File "/Library/Python/2.7/site-packages/django/core/management/__init__.py", line 399, in execute_from_command_line utility.execute() File "/Library/Python/2.7/site

Why does manage.py syncdb fail to connect to google cloud sql database?

吃可爱长大的小学妹 提交于 2020-01-03 17:12:01
问题 During a recent update of an app on Google App Engine I was in the process of updating the database with: SETTINGS_MODE='prod' ./manage.py syncdb This worked last time I ran it, but now I am getting the following error: Traceback (most recent call last): File "./manage.py", line 10, in <module> execute_from_command_line(sys.argv) File "/Library/Python/2.7/site-packages/django/core/management/__init__.py", line 399, in execute_from_command_line utility.execute() File "/Library/Python/2.7/site

Sorting WTForms form.errors dict

孤人 提交于 2020-01-03 17:10:45
问题 The forms.errors dict seems to be sorted on field name, and not on the order they are declared in the form itself. E.g. class ProductForm(Form): code = TextField('Code', validators=[Required()]) description = TextField('Description', validators=[Required(), Length(max=100)]) amount = DecimalField('Amount', validators=[Required(), NumberRange(min=0.00, max=1000000.00)]) vat_percentage = DecimalField('VAT %', validators=[Required(), NumberRange(min=0.00, max=100.00)]) inactive_date = DateField(

GAE - Unable to update: com.google.appengine.tools.admin.HttpIoException:

走远了吗. 提交于 2020-01-03 17:07:48
问题 I tried to upload my test gwt app but I've just faced a quite strange error. Every time I try to upload app I get this: Unable to update app: Error posting to URL: https://appengine.google.com/api/appversion/create?app_id=gwttestapp001&version=1.0& 500 Internal Server Error Server Error (500) A server error has occurred. See the deployment console for more details Unable to update app: Error posting to URL: https://appengine.google.com/api/appversion/create?app_id=gwttestapp001&version=1.0&

GAE - Unable to update: com.google.appengine.tools.admin.HttpIoException:

旧城冷巷雨未停 提交于 2020-01-03 17:07:10
问题 I tried to upload my test gwt app but I've just faced a quite strange error. Every time I try to upload app I get this: Unable to update app: Error posting to URL: https://appengine.google.com/api/appversion/create?app_id=gwttestapp001&version=1.0& 500 Internal Server Error Server Error (500) A server error has occurred. See the deployment console for more details Unable to update app: Error posting to URL: https://appengine.google.com/api/appversion/create?app_id=gwttestapp001&version=1.0&

Google app engine datastore datetime to date in Python?

半腔热情 提交于 2020-01-03 17:03:46
问题 I've always hated the headache of managine dates, times, datetimes, and the various formats and conversions that are needed with them. I'm taking an online course on using the google app engine and it says to use the datetime property, which is returning a date in the format: 2012-06-25 01:17:40.273000 I tried datetime.strptime('2012-06-25 01:17:40.273000','%y-%m-%d %H:%M:%S') but it didn't work.. I just want to extract the 2012-06-25 part without using a hacky regex or string slicing

which are the files uri on GAE java emulating cloud storage with GCS client library?

北城以北 提交于 2020-01-03 16:57:47
问题 I'm developing a web application using Google app engine for Java. I will use Google Cloud storage and according to the documentation, I'm using GCS client library to emulate cloud storage on local disk. I have no problem saving the files, I can see them from eclipse under the war folder (under the path WEB-INF/appengine-generated) and I can see them from the web admin panel accessible from the url localhost:8888/_ah/admin as indicated in this question My question is the following. Which are