3

From the tutorial, which I confirmed by creating a simple project, the index.yaml file is auto-generated when a query is run. What I further observe is that until then the admin console (http://localhost:8080/_ah/admin/datastore) does not show the data-store.

My problem is this: I have a project for which data/entities are to be added manually through the datastore admin console. The website is only used to display/retrieve data, not to add data to the data-store.

How do I get my data-store to appear on the console so I can add data?

Yes, try retrieving from the empty data-store through the browser just so I can get the index.yaml to populate, etc. But that does not work.

3 Answers 3

1

The easiest way is probably just to create a small python script inside your project folder and create your entities in script. Assign it to a URL handler that you'll use once, then disable.

You can even do it from the python shell. It's very useful for debugging, but you'll need to set it up once. http://alex.cloudware.it/2012/02/your-app-engine-app-in-python-shell.html

In order to do the same on production, use the remote_api: https://developers.google.com/appengine/articles/remote_api

Sign up to request clarification or add additional context in comments.

2 Comments

As I mentioned above, this is a basic operation that I can do on phpMyAdmin very easily. Do you know for certain that the GAE Datastore cannot handle this?
The datastore admin API only lets you create entities who's type already exists in the datastore. You'll need to create the first entity another way. Also, the interface is quite limited - you won't be able to create attributes of certain data types with the admin page. It's not a tool to rely on for creating entities.
0

This is a very strange question.

The automatic creation of index.yaml only happens locally, and is simply to help you create that file and upload it to AppEngine. There is no automatic creation or update of that file once it's on the server: and as the documentation explains, no queries can be run unless the relevant index already exists in index.yaml.

Since you need indexes to run queries, you must create that file locally - either manually, or by running the relevant queries against your development datastore - then upload it along with your app.

However, this has nothing at all to do with whether the datastore viewer appears in the admin. Online, it will always show, but only entity kinds that actually have an instance in the store will be shown. The datastore viewer knows nothing about your models, it only knows about kinds that exist in the datastore.

5 Comments

I am working on localhost right now. When I click on Datastore Viewer, under Entity Kind, my Kind is not showing. I confirm the reason that's happening to be because there is no entity instances. Short of creating my own web interface to put() new entities into the datastore, is there a way to add new entities into the datastore through the admin console?
You could use the remote api to do it from the shell.
I only need to do this on localhost. The Remote API will incur quota usage. This is a basic operation that I can do on phpMyAdmin. Do you know for certain that the GAE Datastore cannot handle this?
If you just need to do it on localhost, then write a script to do it and attach it to a handler, as dragonx suggests. And comparisons to phpMyAdmin are irrelevant, as the datastore is not an SQL database.
You should also know that while the behaviour of the local development server seems ok for some applications it will not scale at all well once you add more then a little data. In addition you will not be able to support more then 1 simultaneous users.
0

On your development server you can use the interactive console to create/instantiate/save an entity, which should cause the entity class to appear in the datastore interface, like so:

from google.appengine.ext import ndb

class YourEntityModel(ndb.Model):
    pass

YourEntityModel().put()

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.