Ridley Jones
2018-11-30 18:03:23 UTC
Hi,
Newbie here. I'm working through this tutorial and am on this page:
https://cloud.google.com/python/getting-started/using-cloud-datastore.
Obviously I'm within the 2-structured-data folder of the tutorial project.
I've completed the tasks in that page of the tutorial, successfully. To
help me get how the parts fit together and how to build on the structures
in the project files and just generally understand this environment better,
I wanted to 1. add a new book property (with a certain datatype, integer
maybe), and then 2. create a new entity type that would be CRUDable within
the project.
I found that simply adding a new div to the form.html page flexibly (as
promised) created a new property within Datastore that I was able to edit:
<div class="form-group">
<label for="description">Anotherone</label>
<input type="number" name="newprop" id="newprop" class="form-control"
value="{{book.newprop}}"/>
</div>
Fine--I'm pleased with that. However, what I don't see is how to ensure
that the actual data being uploaded is in fact non-string. (In the
tutorial, the "published date" property was also uploaded as string). If I
were going to edit the model_datastore file or the crud file, how would I
do this to ensure that the newprop property got inserted as numerical? The
documentation briefly says that datastore doesn't enforce typing, that the
application is responsible for that, but how would one modify these
specific tutorial files in order to do that?
My next question is how to create a new entity type within this tutorial.
Do I need to create another app folder, or can I modify (as I said) the
crud or model_datastore files here to accommodate another potential
entity? If I wanted to create a, for example, /publishers entity type and
page?
Thanks so much for your help with what I'm sure is very basic stuff!
Newbie here. I'm working through this tutorial and am on this page:
https://cloud.google.com/python/getting-started/using-cloud-datastore.
Obviously I'm within the 2-structured-data folder of the tutorial project.
I've completed the tasks in that page of the tutorial, successfully. To
help me get how the parts fit together and how to build on the structures
in the project files and just generally understand this environment better,
I wanted to 1. add a new book property (with a certain datatype, integer
maybe), and then 2. create a new entity type that would be CRUDable within
the project.
I found that simply adding a new div to the form.html page flexibly (as
promised) created a new property within Datastore that I was able to edit:
<div class="form-group">
<label for="description">Anotherone</label>
<input type="number" name="newprop" id="newprop" class="form-control"
value="{{book.newprop}}"/>
</div>
Fine--I'm pleased with that. However, what I don't see is how to ensure
that the actual data being uploaded is in fact non-string. (In the
tutorial, the "published date" property was also uploaded as string). If I
were going to edit the model_datastore file or the crud file, how would I
do this to ensure that the newprop property got inserted as numerical? The
documentation briefly says that datastore doesn't enforce typing, that the
application is responsible for that, but how would one modify these
specific tutorial files in order to do that?
My next question is how to create a new entity type within this tutorial.
Do I need to create another app folder, or can I modify (as I said) the
crud or model_datastore files here to accommodate another potential
entity? If I wanted to create a, for example, /publishers entity type and
page?
Thanks so much for your help with what I'm sure is very basic stuff!
--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-appengine+***@googlegroups.com.
To post to this group, send email to google-***@googlegroups.com.
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/eb8464a8-3da3-4e84-b9d1-14c74caddee7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-appengine+***@googlegroups.com.
To post to this group, send email to google-***@googlegroups.com.
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/eb8464a8-3da3-4e84-b9d1-14c74caddee7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.