[google-appengine] Re: How can I edit Entity by query use key.id?

2009-01-12 Thread buck

book = Books.get(Key(self.request.get('id')))
book.name = self.request.get(name)
...


--~--~-~--~~~---~--~~
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 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: External database dump

2009-01-12 Thread Greg Temchenko

I don't think you can use bulk uploader for your purposes but you can
just investigate how it works.
However yes, you can update records. Just use the same key name for
updated records.

On Jan 11, 9:23 pm, gabon nuthink...@googlemail.com wrote:
 Well, Bulk Data Uploader seems definitely very useful. What if I would
 like to update the records? (every now and then)

 Thanks, chr

 On Jan 11, 3:31 pm, Greg Temchenko soid@gmail.com wrote:

  I mean GAE data uploader. You can read 
  here:http://code.google.com/appengine/articles/bulkload.html

  It splits a csv file into 10 lines requests and inserts it step by
  step.

  On Jan 11, 3:45 pm, gabon nuthink...@googlemail.com wrote:

   I started optimizing everywhere. Now I have a textarea input where I
   paste a json string (I presume is faster to parse than xml). I still
   got problems.

   Is it really the solution to split the operation in more manual steps?
   Is it not possible to have an automatized and longer process, giving
   for instance breaks to the CPU with time.sleep() ?

   How could I split in an automatic way the update of thousands of
   entities? I am thinking on redirecting the page to a new url passing
   the data to update and every time processing some. It sounds pretty
   crazy, but if the limit is the time to generate a page I don't see
   other solutions.

   With bulkloader, you mean the actionscript 3 library?

   Thanks, chr

   On Jan 11, 12:18 pm, Greg Temchenko soid@gmail.com wrote:

I guess you have to split your XML file and work with it by steps.
Did you see how bulkloader works?

On Jan 11, 2:04 pm, gabon nuthink...@googlemail.com wrote:

 I would like to use GAE with the data created and maintained in a
 different application in a different server. My solution was to
 generate an xml file with all the data and parse it to create/update
 the GAE related entities.
 Clearly this is not a CPU friendly solution (especially considering
 that fetch operations are considered as CPU operations!) and I get a
 nice Dude, this is whack! message with errors and CPU quota warning
 in the logs. I will try to copy the xml MANUALLY in an input field to
 get rid of the errors (this procedure looks whack to me!), but since
 the entities to update are thousands, I have the feeling that won't be
 enough.

 Is there any other recommended way to work with large data without
 creating CPU issues? I don't know using time.sleep() to give the CPU a
 break? It seems the CPU errors are pretty common, probably Google
 should give more info about how to avoid them.

 Thanks, chr
--~--~-~--~~~---~--~~
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 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: How to upload APP through an *proxy server with basic authentication* .

2009-01-12 Thread ramu

No replies yet...

On Jan 11, 5:45 am, ramu rslet...@gmail.com wrote:
 Dear Google App Engine Developer ,

 I am halfway completing my real app but can't get a way to upload this
 basic learning hello world app. Please Help Me. I am ataching the
 error logs as screen shoot.

 Thanks in advance.

 Error :

 http://picasaweb.google.com/lh/photo/7mWe7DzlYAH88v1op55Z6Q?feat=dire...
--~--~-~--~~~---~--~~
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 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] phone number wont verify

2009-01-12 Thread computero71

cant point my cname to *appspot or ghs.google wants to verify phone
number then says already used to verify ?
man ill tell ya 

was working fine for 1 evening the next morning wont hit 
--~--~-~--~~~---~--~~
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 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: How to upload APP through an *proxy server with basic authentication* .

2009-01-12 Thread Alexander Kojevnikov

Try replacing

  SET HTTP_PROXY = 202:141:80:22:3128

with

  SET HTTP_PROXY=http://202.141.80.22:3128;

On Jan 12, 10:59 pm, ramu rslet...@gmail.com wrote:
 No replies yet...

 On Jan 11, 5:45 am, ramu rslet...@gmail.com wrote:

  Dear Google App Engine Developer ,

  I am halfway completing my real app but can't get a way to upload this
  basic learning hello world app. Please Help Me. I am ataching the
  error logs as screen shoot.

  Thanks in advance.

  Error :

 http://picasaweb.google.com/lh/photo/7mWe7DzlYAH88v1op55Z6Q?feat=dire...
--~--~-~--~~~---~--~~
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 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Creating a short unique URL for an entity

2009-01-12 Thread Jesse Grosjean

 You could use the id instead of the key, key().id, then you can get it
 back with just DocModel.get_by_id(id)

 You should be able to go straight to the doc without the parent
 account id /doc/12345

 I'm not sure you can guarantee id uniqueness across your whole data
 store, but it should be unique for any given model?

Thanks for your reply. If ID is unique across a particular kind that's
good enough for me... I don't need a globally unique ID across all
entity kinds, just across a specific entity kind. I'm still curious if
anyone knows for sure if these IDs are unique across the entire store,
or just unique across a given entity group. Very possibly I'm just
missing it, but I can't seem to find this in the documentation. That
would make me assume that they are globally unique, but then it is
unclear to me what Key() has the parent entity group encoded in it for
entities that are part of a given group.

Jesse
--~--~-~--~~~---~--~~
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 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Multiple WSGI apps

2009-01-12 Thread arnie

Hi all
Using Google App Engine SDK with default port setting of 8080. I have
two WSGI applications [App1 and App2 both are web services with no UI
related code in them]. App1 is running on default port 8080. Can dev
server listens for multiple web applications on same port? If no, then
what other ports can be used?
Also these two apps need to access two tables [1 To Many
relationship], when we go to deploy these apps on GAE do I need
seperate application ID for these two apps [I think:YES but google
DOCS says per mobile phone # there is only one app ID]?
Can these two applications be able to access the common data model or
do I need to do some special coding for this?
Thanks from a GAE fresher
arnie
--~--~-~--~~~---~--~~
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 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Multiple WSGI apps

2009-01-12 Thread djidjadji

Why not select the two different Apps with your app.yaml file

- url: /app1/.*
  script: App1.py

- url: /app2/.*
  script: App2.py


Or you can put both handlers in one py file and select the one you need with

class App1Handler(webapp.RequestHandler):
  def get(self,todo):
pass

application = webapp.WSGIApplication(
  [('/app1/(.*)', App1Handler),
   ('/app2/(.*)', App2Handler),
  ],
  debug=False)

If they need to use the same data then they must be uploaded under 1 app ID.
You have one administrator per mobile phone, and an administrator can
have 10 application IDs.

2009/1/12 arnie parvez...@rediffmail.com:

 Hi all
 Using Google App Engine SDK with default port setting of 8080. I have
 two WSGI applications [App1 and App2 both are web services with no UI
 related code in them]. App1 is running on default port 8080. Can dev
 server listens for multiple web applications on same port? If no, then
 what other ports can be used?
 Also these two apps need to access two tables [1 To Many
 relationship], when we go to deploy these apps on GAE do I need
 seperate application ID for these two apps [I think:YES but google
 DOCS says per mobile phone # there is only one app ID]?
 Can these two applications be able to access the common data model or
 do I need to do some special coding for this?
 Thanks from a GAE fresher
 arnie
 


--~--~-~--~~~---~--~~
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 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Creating a short unique URL for an entity

2009-01-12 Thread Anthony

http://groups.google.com/group/google-appengine/browse_thread/thread/517a9ad5edd263d2/67a5160882462463?lnk=gstq=are+ids+unique#67a5160882462463

http://code.google.com/appengine/docs/datastore/keysandentitygroups.html#Entity_Groups_Ancestors_and_Paths

Looks like they are unique for a given kind  parent path.. so you
will need to use the parent into the path.


On Jan 12, 1:59 pm, Jesse Grosjean je...@hogbaysoftware.com wrote:
  You could use the id instead of the key, key().id, then you can get it
  back with just DocModel.get_by_id(id)

  You should be able to go straight to the doc without the parent
  account id /doc/12345

  I'm not sure you can guarantee id uniqueness across your whole data
  store, but it should be unique for any given model?

 Thanks for your reply. If ID is unique across a particular kind that's
 good enough for me... I don't need a globally unique ID across all
 entity kinds, just across a specific entity kind. I'm still curious if
 anyone knows for sure if these IDs are unique across the entire store,
 or just unique across a given entity group. Very possibly I'm just
 missing it, but I can't seem to find this in the documentation. That
 would make me assume that they are globally unique, but then it is
 unclear to me what Key() has the parent entity group encoded in it for
 entities that are part of a given group.

 Jesse
--~--~-~--~~~---~--~~
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 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Possible workaround for datastore timeouts

2009-01-12 Thread bowman.jos...@gmail.com

I've added issue 982: 
http://code.google.com/p/googleappengine/issues/detail?id=982
as an issue to include a possible workaround for the datastore
timeouts.

Here's the text of the issue:

From what I can tell, it's not a case of if you're going to get
datastore
timeouts on puts, but when. My original thought was for input actions
on my
application to use javascript to do the action, catching timeouts and
trying again. On a scripted input I have for my site this has worked
extremely well for making sure the data gets into my site.

However, when I started taking into account all the writes that happen
through the operation of my site, I realized that this methodology
makes
more sense to integrate at a lower level than the front end.

When I have time, after I fix a few other things with my application,
I
intend to look at creating a new Model for my site to use which will
handle
this at the put() level.

Something to the effect of:

MAX_PUT_RETRIES = 3

count = 0
while count  MAX_PUT_RETRIES:
''' try to put the data.
if the put fails due to a datastore timeout, increase
the count and try to put again. Ideally throw another
exception if it hits MAX_PUT_RETRIES without adding the
data.'''

If something like this could be added to GAE directly, I think it
would
help a lot of people. Though of course the extra CPU usage caused by
these
timeouts would still be an issue.

--~--~-~--~~~---~--~~
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 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: why java

2009-01-12 Thread Raffaele Castagno

On Dec 31 2008, 5:04 pm, Aramaki ciber...@gmail.com wrote:

 - The comunity interest in implementingjavawill give you so much
 advantage or it is because you do no want to learn python

For me, the same reason I prefer groovy over other dynamic languages:
I know java.
I have a java background, I know java tools, I have java snippets, I
have java books.
(and yes, I hate using intentation to define blocks of code...)

And I believe that there are many like me.

Groovy 4 GAE! :)

Raffaele
--~--~-~--~~~---~--~~
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 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] typical scenario

2009-01-12 Thread arnie

Hi all
I have three folders
BusinessList
Conversion
DB

First two folders contains one WSGI app [no UI] each. The last folder
contains a datta model [2 tables with 1- to Many relationship]
Each WSGI app accesses the data model in DB folder. My problem is that
If I place the data model file in DB folder then none of the wsgi app
is able to locate it. If I copy the datamodel file in each of the wsgi
folder, it works
My urgent requirement is to access the data model file in DB folder?
What should I do?
All the three folders are in C:\APP\

--~--~-~--~~~---~--~~
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 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Global Time Synchronisation Guarantees

2009-01-12 Thread Cesium


 Marzia  in this thread has already said they dont offer any guarantees.


Is Marzia a primary source?

 I'm still unsure how knowing that (say) it shouldnt deviate more than
 10 seconds is actully going to help. What will you do with that
 figure?

I'd compare the stated maximum uncertainty with my application's
limit (1s). In this case 10  1, oops.

The only (reasonable) alternative I see would be to work with NIST
to roll out a time service on port 80 using HTTP transport; in a
timely manner. (Pun intended.)

Cesium

--~--~-~--~~~---~--~~
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 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: typical scenario

2009-01-12 Thread Gipsy Gopinathan
I guess you can use the import statement in the other directories to access
anything from DB floder
lets say if you have  models.py in DB folder contains your data model
classes
then  in the other directories you can access it by

from DB import models




On Mon, Jan 12, 2009 at 9:09 AM, arnie parvez...@rediffmail.com wrote:


 Hi all
 I have three folders
 BusinessList
 Conversion
 DB

 First two folders contains one WSGI app [no UI] each. The last folder
 contains a datta model [2 tables with 1- to Many relationship]
 Each WSGI app accesses the data model in DB folder. My problem is that
 If I place the data model file in DB folder then none of the wsgi app
 is able to locate it. If I copy the datamodel file in each of the wsgi
 folder, it works
 My urgent requirement is to access the data model file in DB folder?
 What should I do?
 All the three folders are in C:\APP\

 



-- 
cheers
Gipsy

--~--~-~--~~~---~--~~
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 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: typical scenario

2009-01-12 Thread Alexander Kojevnikov

Try adding an empty __init__.py file into your DB folder. This marks
the DB folder as a 'package' and allows you to import modules from it.
More info at:
http://www.python.org/doc/2.5.2/tut/node8.html

On Jan 13, 2:09 am, arnie parvez...@rediffmail.com wrote:
 Hi all
 I have three folders
 BusinessList
 Conversion
 DB

 First two folders contains one WSGI app [no UI] each. The last folder
 contains a datta model [2 tables with 1- to Many relationship]
 Each WSGI app accesses the data model in DB folder. My problem is that
 If I place the data model file in DB folder then none of the wsgi app
 is able to locate it. If I copy the datamodel file in each of the wsgi
 folder, it works
 My urgent requirement is to access the data model file in DB folder?
 What should I do?
 All the three folders are in C:\APP\
--~--~-~--~~~---~--~~
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 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Global Time Synchronisation Guarantees

2009-01-12 Thread Tony Arkles



On Jan 12, 9:18 am, Cesium cesiumpic...@gmail.com wrote:
  Marzia  in this thread has already said they dont offer any guarantees.

 Is Marzia a primary source?

Yes, Marzia is part of the app engine team.

--~--~-~--~~~---~--~~
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 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Announcing: System Status Dashboard, Quota Details Page, and a Preview of Billing

2009-01-12 Thread Geoffrey Spear

The quota is 864 memcache API calls/day, and
http://code.google.com/appengine/docs/quotas.html#Memcache doesn't
list it as adjustable which seems to be an indication that you won't
be able to purchase more.

On Jan 11, 8:34 pm, altden alt...@gmail.com wrote:
 What about memcache? I could not find prices (or even quotas) for
 memcache API.

 On Jan 8, 2:00 pm, Marzia Niccolai ma...@google.com wrote:

  Hi,

  First, regarding Google Checkout - this will be the only method of payment
  available when billing launches, however, we are still committed to
  supporting our developers who live in the few countries where Google
  Checkout is not available. For developers located in those countries, quotas
  for particular applications may be raised.  Decisions will be made strictly
  on a case-by-case basis and may take up to two weeks

  The pricing upon launch of billing can be found 
  here:http://googleappengine.blogspot.com/2008/05/announcing-open-signups-e...

  -Marzia

  On Thu, Jan 8, 2009 at 9:44 AM, mclovin hanoo...@gmail.com wrote:

   Am i missing something somewhere? I cant seem to find any pricing for
   commericial applications even though google advertises app engine as a
   solution for commericial deployment.
--~--~-~--~~~---~--~~
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 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Verification - what format will be accepted

2009-01-12 Thread bannerdyne

Hi,

I am using a supported carrier in Australia. I cannot get my mobile
number to be accepted.

The message I get is:

There were errors: * Mobile Number or Username

Is there a special format I need to use?

This is the format I am using. Any help would be appreciated.

61  000 000

Thanks

--~--~-~--~~~---~--~~
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 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: How to upload APP through an *proxy server with basic authentication* .

2009-01-12 Thread Jan Hesko-Kołodziński
Have you change application name in app.yaml?

2009/1/12 ramu rslet...@gmail.com


 No replies yet...

 On Jan 11, 5:45 am, ramu rslet...@gmail.com wrote:
  Dear Google App Engine Developer ,
 
  I am halfway completing my real app but can't get a way to upload this
  basic learning hello world app. Please Help Me. I am ataching the
  error logs as screen shoot.
 
  Thanks in advance.
 
  Error :
 
  http://picasaweb.google.com/lh/photo/7mWe7DzlYAH88v1op55Z6Q?feat=dire...
 


--~--~-~--~~~---~--~~
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 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Phone number verification error - Australia

2009-01-12 Thread bannerdyne

Hi,

I am using a supported Australian carrier but am getting the following
error when I try to verify.

There were errors: * Mobile Number or Username

I am using the following format 61  000 000. I have tried removing
spaces, adding + symbol.

Can you please tell me what the format for an Australian number should
be?

Thanks

--~--~-~--~~~---~--~~
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 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: user login URLs in html/javascript

2009-01-12 Thread Geoffrey Spear



On Jan 11, 10:56 pm, thebrianschott schott.br...@gmail.com wrote:
 Gipsy,

 It is a consequence of my chosen design, to allow both clients and
 organizers to enter the app via the same door. This way the
 organizers can identify themselves before they enter the app so that
 they need not be asked later who they are, because I was having
 difficulty coding something like a javascript-confirm-dialog in
 python, to ask that question, so I elected to do it this way.

You still almost certainly want your app to dynamically generate the
links at runtime; I don't believe there's any guarantee that these
hardcoded links will keep working if Google changes the login system,
and the users API specifically includes functions that return the
correct URLs so you don't have to hardcode them.

I'm not sure why you think hardcoding in the link rather than
generating it at runtime has anything to do with the ability to not
require people to click it.  It still just shows up as a link on a
webpage.
--~--~-~--~~~---~--~~
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 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: versions share db?

2009-01-12 Thread Roman

That means that there cannot be a change in the models definitions
between
versions.

v2 of an app is presumably for testing, so the data there need not be
preserved.
If the data in v1 needs to be preserved after the switch to v2
one can always dump and restore the db.

On Jan 11, 10:01 pm, Alexander Kojevnikov alexan...@kojevnikov.com
wrote:
 The entities in the datastore are shared, the code and static files
 are not.

 I don't think splitting the datastore per app version is such a good
 idea. What if the data is added to v1 of the datastore while you are
 testing v2? At the same time you are modifying your v2 datastore
 (otherwise, you wouldn't need different datastores per app version).
 You would have to merge somehow the data from v1 to v2 before
 switching to v2.

 On Jan 12, 1:46 pm, Roman roman.budzianow...@gmail.com wrote:

  It appears that different versions of an app share the db. Do they
  share other stuff? Is it possible to have a separate db for each
  version? A pointer to a precise definition of what constitutes a
  version of an app would be appreciated (http://code.google.com/
  appengine/docs/configuringanapp.html doesn't tell me much).
--~--~-~--~~~---~--~~
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 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Global Time Synchronisation Guarantees

2009-01-12 Thread Cesium

   Marzia  in this thread has already said they dont offer any guarantees.

  Is Marzia a primary source?

 Yes, Marzia is part of the app engine team.

I'm hosed.

Cesium

--~--~-~--~~~---~--~~
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 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Global Time Synchronisation Guarantees

2009-01-12 Thread Brett Slatkin

On Mon, Jan 12, 2009 at 9:59 AM, Cesium cesiumpic...@gmail.com wrote:
   Marzia  in this thread has already said they dont offer any guarantees.

  Is Marzia a primary source?

 Yes, Marzia is part of the app engine team.

 I'm hosed.

Cesium,

What algorithm are you trying to implement that requires synchronized
clocks? To my knowledge it's a pretty well-known best-practice to
never rely on clocks being the same across a distributed system. Some
algorithms can take advantage of closely correlated clocks, but I
believe they never need anything better than the guarantees of NTP
(http://en.wikipedia.org/wiki/Network_Time_Protocol), which is
essentially what App Engine provides.

If you need a guaranteed ordering of time, there are a few ways to do
this. One simple way is to use a set of incrementing sequence numbers
in the Datastore. Every time an event happens, you transactionally
increment the sequence number and write the event record to the
Datastore. Then it doesn't matter what the timestamp is on the record,
the events will always be ordered by the absolute time that they came
in. This has some scalability issues (because you essentially have a
global counter). But if you can partition your data reasonably, you
could probably optimize throughput quite a bit.

Another way is to use a technique like Andy Freeman mentioned. Every
time you store an event record, you also write the new maximum
timestamp to the Datastore (or preferably memcache). To determine that
initial timestamp, you can query for the maximum timestamp record with
the latest timestamp. This will likely result in events that happen at
exactly the same time, though.

If you need to guarantee that you always have ascending timestamps
that are never the same, then you'll need to use a
sequence-number-like solution as I described before. To make this
scale correctly, you would want to partition your sequence number
counters based on the event incidence time. That way if you got two
events at exactly t=10.123 seconds, you could do two transactional
updates and end up with one event at t=10.1230 and another at
t=10.1231. The throughput of this solution will depend on the
resolution of your clock. I hope that all makes sense.

-Brett

--~--~-~--~~~---~--~~
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 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: External database dump

2009-01-12 Thread gabon

This HandleEntity looks very cool!

thanks a lot, chr

On Jan 12, 9:05 am, djidjadji djidja...@gmail.com wrote:
 You can implement your own HandleEntity()

 class MyLoader(bulkload.Loader):
   def HandleEntity(self, entityNew):
 - look for an entity with the same primary key
 - if found
       update the attributes of this entity from entityNew (a dict)
       entity.put()
       return None  # bulkload will ignore this
 - else
       return entityNew   # bulkload will create a new entity

 Reduce the batch_size (default 10) because you do a lot more datastore
 work during updates.

 ./bulkload_client.py --batch_size=4

 2009/1/11 gabon nuthink...@googlemail.com:



  Well, Bulk Data Uploader seems definitely very useful. What if I would
  like to update the records? (every now and then)

  Thanks, chr
--~--~-~--~~~---~--~~
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 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: user login URLs in html/javascript

2009-01-12 Thread thebrianschott

Geoffrey,

It is not my desire to hardcode the urls, but I don't know how not to;
my programming skills are limited. Or maybe I have not understood the
suggests given here by you folks about how to do it in a way that is
not hardcoded.

The path a user takes in my application depends on whether s/he is
logged in or not, and if logged in, whether s/he goes to a map s/he
created or not. If a person has a google account, s/he may not want to
use the app as if s/he does, because s/he will see different results
from her/his users.

On top of that, the users only interface with the app is via html
pages, not python pages, so I don't know how to put links that change
or appear and disappear according to user responses, into an html
page. If I were to wait to ask the user about his/her logging
preference at key times while the python program is in control, that
would be ok, but I don't know how to do that in a way that keeps the
html page visible in the background the way a javascript confirm
dialog produces a little popup dialog window; that's my first choice,
but I don't know how.

My inclination is more toward developing another related app now, but
I would be pleased to learn how to code a softcoded link if you or
others can explain it to me.

Thanks very much for expressing your question.


On Jan 12, 12:11 pm, Geoffrey Spear geoffsp...@gmail.com wrote:

 You still almost certainly want your app to dynamically generate the
 links at runtime; I don't believe there's any guarantee that these
 hardcoded links will keep working if Google changes the login system,
 and the users API specifically includes functions that return the
 correct URLs so you don't have to hardcode them.

 I'm not sure why you think hardcoding in the link rather than
 generating it at runtime has anything to do with the ability to not
 require people to click it.  It still just shows up as a link on a
 webpage.

Brian in Atlanta
--~--~-~--~~~---~--~~
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 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Can Two Applications handshake info?

2009-01-12 Thread Krishna Gollapudi

Hello,

   I am trying to built a supply chain with two applications,say one
application takes in the information from the user and the other
application deals with one raw material.
  Suppose these two applications are hosted in google app engine,will
they be able to exchange data?

regards,
Krishna Gollapudi

--~--~-~--~~~---~--~~
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 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Update just one (or few) files

2009-01-12 Thread Marzia Niccolai

Hi,

At this time, appcfg.py will update any file that has changed since
the last update.  There is now way to specify only a subset of files
to update.

-Marzia

On Sat, Jan 10, 2009 at 10:06 AM, Nefarious mike...@gmail.com wrote:

 So, I want to update just one file on production GAE, however, I have
 many changes locally.  I don't want to update all my files with all
 changes, just one file.   Does anyone know if it is possible to just
 update one (or a few) files while not updating all your local
 changes?  Ideally, some flag in appcfg.py which just specifies one
 file?  Oh how I wish I had tagged things in CVS.
 


--~--~-~--~~~---~--~~
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 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Global Time Synchronisation Guarantees

2009-01-12 Thread Cesium


 What algorithm are you trying to implement that requires synchronized
 clocks? To my knowledge it's a pretty well-known best-practice to
 never rely on clocks being the same across a distributed system. Some
 algorithms can take advantage of closely correlated clocks, but I
 believe they never need anything better than the guarantees of NTP
 (http://en.wikipedia.org/wiki/Network_Time_Protocol), which is
 essentially what App Engine provides.


My application requires a time stamp from GAE that differs from
UTC by no more than 1s. (I'll worry about latencies.)
Imagine for example, a global network of sensors that measure
geophysical data. The usefulness of the data is degraded if there
is a large uncertainty surrounding the sample epoch (timestamp).

I'm confused.
   Marzia  in this thread has already said they dont offer any guarantees.

but you say:
 ...the guarantees of NTP
 (http://en.wikipedia.org/wiki/Network_Time_Protocol), which is
 essentially what App Engine provides.

NTP is pretty good. Better than 1 second. That would suffice.

In summary, my understanding is that GAE does not offer
any guarantees about the uncertainty of their server clocks,
but they do run NTP.

So, when the server clocks are tightly phase-locked to UTC
via NTP, all is well. But when they are not sync'd, we'd have
no indication that a given timestamp is far from UTC (  1s).
There are no guarantees that they'd bypass a server that
greatly differed from UTC.

Is that the state of things?
Cesium





--~--~-~--~~~---~--~~
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 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Can Two Applications handshake info?

2009-01-12 Thread Jonk

On 12 tammi, 21:18, Krishna Gollapudi gnkchaita...@gmail.com wrote:

    I am trying to built a supply chain with two applications,say one
 application takes in the information from the user and the other
 application deals with one raw material.
   Suppose these two applications are hosted in google app engine,will
 they be able to exchange data?


Can't imagine any other way than using the URL Fetch API to talk to
other apps. There's no equivalent to SysV IPC or other such
mechanisms :)


j


--~--~-~--~~~---~--~~
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 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] What is the fastest way to check if an item is in the datastore?

2009-01-12 Thread SM


I have a simple model like this:

class MyModel(db.Model):
  prop = db.StringProperty()
  active = db.BooleanProperty(default=False)

Given an input string, s, I'd like to know if it is in the datastore.
Would this be the best way to check?

if MyModel.gql(WHERE prop = :1 AND active = True, s).fetch(1):
  print Found
else:
  print Not found

Is there a faster/better way? Do I need to do anything with indexes to
make this query better?

--~--~-~--~~~---~--~~
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 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Can not delete entity using Data Viewer and a GQL query.

2009-01-12 Thread Marzia Niccolai

Hi,

If you reply with your app id I can look in to it directly.

If you can find the data in the dataviewer, however, you can get the
key string (from the data's URL) and call db.delete() directly on that
key in your application (if, for instance, you included something like
shell with your application so you could run interactive commands).

-Marzia

On Sun, Jan 11, 2009 at 1:33 PM, murexconsult...@googlemail.com
robin_ow...@hedge-row.co.uk wrote:

 There was a bug in my app and some bad data got into the Datastore.

 So I want to delete some data. The models have a number of items so
 rather than paging through them all 20 at a time to find it I ran the
 GQL query:
 SELECT * FROM UserUpdates
 WHERE windAngle=328

 This returns one row as expected. I then click on the tickbox beside
 it and click on Delete.

 I then get a dialog box asking if I am sure to which I say yes.

 I then get the error displayed in a red box at the top saying The URL
 to forward to once the request is fulfilled - Yes the error is a
 partial sentence and makes no sense.

 The item is NOT deleted.

 This is happening to all 4 of my models. However 2 of them only have a
 few hundred entries, so I was able to page through, find the item and
 delete it. When I paged through, the deleting was successful.

 I think that there must be a bug in the data viewer when removing data
 found using a gql query.


 Thanks
 


--~--~-~--~~~---~--~~
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 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Update just one (or few) files

2009-01-12 Thread Ryan W

Version control becomes essential for maintaining app engine apps.
With Subversion, for instance, you can tag your repository whenever
you deploy, then keep working along the trunk.  If you want to make a
change to the current production app, check out the tag, make the
change and deploy again.  Make sure to merge the change into the trunk
though, either manually or with the Subversion merge tools.

I haven't been doing this very well myself yet, but do run into this
issue a lot, so will be starting to more.  Since App Engine does have
the awesome versioning, it would be handy to also sync up the App
Engine version label with the tag you use in your source control.

On Jan 10, 10:06 am, Nefarious mike...@gmail.com wrote:
 So, I want to update just one file on production GAE, however, I have
 many changes locally.  I don't want to update all my files with all
 changes, just one file.   Does anyone know if it is possible to just
 update one (or a few) files while not updating all your local
 changes?  Ideally, some flag in appcfg.py which just specifies one
 file?  Oh how I wish I had tagged things in CVS.
--~--~-~--~~~---~--~~
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 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Unsupported type in GQL query with IN clause

2009-01-12 Thread Paul

Am i doing something crazy or should i report this as a bug?


On Jan 9, 6:45 pm, Paul pwid...@gmail.com wrote:
 I have a GQL query that works fine when theres only one Merchant
 Entity, but fails as below when theres more than 1, any ideas?

 merchantList= [e.key() for e in Merchant.all().fetch(10)]

 Item.gql('WHERE style = :style and merchant in :merchants ORDER BY
 __key__',style=theStyle,merchants=merchantList)

   846.     entities = query.fetch(numItems)
 File /home/paul/projects/outfitsis/.google_appengine/google/appengine/
 ext/db/__init__.py in fetch
   1377.     raw = self._get_query().Get(limit, offset)
 File /home/paul/projects/outfitsis/.google_appengine/google/appengine/
 ext/db/__init__.py in _get_query
   1659.     return self._proto_query.Bind(self._args, self._kwds)
 File /home/paul/projects/outfitsis/.google_appengine/google/appengine/
 ext/gql/__init__.py in Bind
   256.         query.update(enumerated_query)
 File /home/paul/projects/outfitsis/.google_appengine/google/appengine/
 api/datastore.py in update
   1036.       self.__setitem__(filter, value)
 File /home/paul/projects/outfitsis/.google_appengine/google/appengine/
 api/datastore.py in __setitem__
   979.     datastore_types.ValidateProperty(' ', value,
 read_only=True)
 File /home/paul/projects/outfitsis/.google_appengine/google/appengine/
 api/datastore_types.py in ValidateProperty
   1066.           'Unsupported type for property %s: %s' % (name,
 v.__class__))

 Exception Type: BadValueError at /design/
 Exception Value: Unsupported type for property  : class
 'food.models.Merchant'

 Running appengine_1.1.7
--~--~-~--~~~---~--~~
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 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Unsupported type in GQL query with IN clause

2009-01-12 Thread Marzia Niccolai

Hi,

What is the model definition for Item?

-Marzia

On Mon, Jan 12, 2009 at 2:58 PM, Paul pwid...@gmail.com wrote:

 Am i doing something crazy or should i report this as a bug?


 On Jan 9, 6:45 pm, Paul pwid...@gmail.com wrote:
 I have a GQL query that works fine when theres only one Merchant
 Entity, but fails as below when theres more than 1, any ideas?

 merchantList= [e.key() for e in Merchant.all().fetch(10)]

 Item.gql('WHERE style = :style and merchant in :merchants ORDER BY
 __key__',style=theStyle,merchants=merchantList)

   846. entities = query.fetch(numItems)
 File /home/paul/projects/outfitsis/.google_appengine/google/appengine/
 ext/db/__init__.py in fetch
   1377. raw = self._get_query().Get(limit, offset)
 File /home/paul/projects/outfitsis/.google_appengine/google/appengine/
 ext/db/__init__.py in _get_query
   1659. return self._proto_query.Bind(self._args, self._kwds)
 File /home/paul/projects/outfitsis/.google_appengine/google/appengine/
 ext/gql/__init__.py in Bind
   256. query.update(enumerated_query)
 File /home/paul/projects/outfitsis/.google_appengine/google/appengine/
 api/datastore.py in update
   1036.   self.__setitem__(filter, value)
 File /home/paul/projects/outfitsis/.google_appengine/google/appengine/
 api/datastore.py in __setitem__
   979. datastore_types.ValidateProperty(' ', value,
 read_only=True)
 File /home/paul/projects/outfitsis/.google_appengine/google/appengine/
 api/datastore_types.py in ValidateProperty
   1066.   'Unsupported type for property %s: %s' % (name,
 v.__class__))

 Exception Type: BadValueError at /design/
 Exception Value: Unsupported type for property  : class
 'food.models.Merchant'

 Running appengine_1.1.7
 


--~--~-~--~~~---~--~~
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 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: I need help~

2009-01-12 Thread Marzia Niccolai

Hi,

execfile is a builtin Python function, so it seems like there is
something amiss with your python installation.  What version of Python
are you using?  Does it run, and can you use built-in functions, from
the command line interpreter? What is your PYTHONPATH?

-Marzia

On Fri, Jan 9, 2009 at 6:51 PM, qhzh...@live.cn qhzh...@live.cn wrote:

 Hi:
  Today I try to use dev_appserver.py helloworld/, but it allways
 error that:

 Traceback most recent call last:
  File C:\Prongram Files\Google\google_appengine\dev_appserver.py,
 line 50, in module
 execfilescript_path,globals
 NameError: name 'execfile' is not defined

 How can I solve it?
 Thanks!

 


--~--~-~--~~~---~--~~
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 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Verification - what format will be accepted

2009-01-12 Thread Alexander Kojevnikov

This format worked for me: +61 4xx xxx xxx

It looks like you are including a leading '0' after the country code,
try removing it.

See also this thread: http://is.gd/fBro

On Jan 12, 10:02 pm, bannerdyne derek.new...@bannerdyne.com wrote:
 Hi,

 I am using a supported carrier in Australia. I cannot get my mobile
 number to be accepted.

 The message I get is:

 There were errors:     * Mobile Number or Username

 Is there a special format I need to use?

 This is the format I am using. Any help would be appreciated.

 61  000 000

 Thanks
--~--~-~--~~~---~--~~
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 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Phone number verification error - Australia

2009-01-12 Thread Alexander Kojevnikov

See http://is.gd/fBsX

On Jan 12, 11:58 pm, bannerdyne derek.new...@bannerdyne.com wrote:
 Hi,

 I am using a supported Australian carrier but am getting the following
 error when I try to verify.

 There were errors: * Mobile Number or Username

 I am using the following format 61  000 000. I have tried removing
 spaces, adding + symbol.

 Can you please tell me what the format for an Australian number should
 be?

 Thanks
--~--~-~--~~~---~--~~
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 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: The Chinese SDK version is 1.1.0 ,WHY?

2009-01-12 Thread Marzia Niccolai

Hi,

We are working on making sure all of the SDK download links in our
translated documentation get updated when a new SDK is released.
However, the latest SDK is always available from our codesite project:

http://code.google.com/p/googleappengine

-Marzia

On Sat, Jan 10, 2009 at 8:15 PM, WaChepai yabin.c...@gmail.com wrote:

 I download the Google App Engine SDK from google, the Chinsese version
 is 1.1.0 but the English version is 1.1.7 ,
 Just why?

 http://code.google.com/intl/zh-CN/appengine/downloads.html
 Windows 1.1.0 - 5/28/08 GoogleAppEngine_1.1.0.msi   2.5 MB
 e0c0bc69e8005fbf338ef40ea569f890b25ea011

 But,

 http://code.google.com/intl/en/appengine/downloads.html
 PlatformVersion Package SizeSHA1 Checksum
 Windows 1.1.7 - 11/21/08GoogleAppEngine_1.1.7.msi   2.6 MB
 26049db14b41e87b7b80a769cd479ad1e06824b1

 


--~--~-~--~~~---~--~~
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 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: What is the fastest way to check if an item is in the datastore?

2009-01-12 Thread Alexander Kojevnikov

 Is there a faster/better way? Do I need to do anything with indexes to
 make this query better?

You can replace fetch(1) with get(), which is essentially the same.
Other than that, if you know your entity's id/key_name, it's slightly
faster to fetch it using get_by_id() or get_by_key_name().
--~--~-~--~~~---~--~~
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 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Retrieving latest revision of a document

2009-01-12 Thread Ecir Hana

Hello,
what is the preferred way of retrieving the latest revision of a
document?
(The 'name' doesn't change across the revisions.)

1:
class Document(db.Model):
  name = db.StringProperty()
  revision = db.IntegerProperty()
  content = db.TextProperty()

latest = Document.all().filter('name =', some_name).order('-
revision').get()

2:
class Document(db.Model):
  name = db.StringProperty()

class Revision(db.Model):
  document = db.ReferenceProperty(Document,
collection_name='revisions')
  revision = db.IntegerProperty()
  content = db.TextProperty()

document = Document.all().filter('name =', some_name).get()
latest = document.revisions.order('-revision').get() [1]

3:
something different altogether?

[1] Is it ok to call .get() for the second time?

Thanks in advance!

--~--~-~--~~~---~--~~
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 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Retrieving latest revision of a document

2009-01-12 Thread Alexander Kojevnikov

The first variant is faster while the second one requires less
maintenance if you rename your documents a lot. Both will do the job.

I'd use the first, de-normalised model unless you normally have a lot
of revisions per document, modify the common document meta-data quite
often, and the meta-data itself is large (in terms of the number of
bytes or the number of properties stored).

On Jan 13, 10:33 am, Ecir Hana ecir.h...@gmail.com wrote:
 Hello,
 what is the preferred way of retrieving the latest revision of a
 document?
 (The 'name' doesn't change across the revisions.)

 1:
 class Document(db.Model):
   name = db.StringProperty()
   revision = db.IntegerProperty()
   content = db.TextProperty()

 latest = Document.all().filter('name =', some_name).order('-
 revision').get()

 2:
 class Document(db.Model):
   name = db.StringProperty()

 class Revision(db.Model):
   document = db.ReferenceProperty(Document,
 collection_name='revisions')
   revision = db.IntegerProperty()
   content = db.TextProperty()

 document = Document.all().filter('name =', some_name).get()
 latest = document.revisions.order('-revision').get() [1]

 3:
 something different altogether?

 [1] Is it ok to call .get() for the second time?

 Thanks in advance!
--~--~-~--~~~---~--~~
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 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Unsupported type in GQL query with IN clause

2009-01-12 Thread Paul

Hi Marzia, heres everything i could think of that might be relevent:

[Edit Item - ImgItem]:
ImgItem.gql('WHERE style = :style and merchant in :merchants ORDER BY
__key__',style=theStyle,merchants=merchantList)

class Item(BaseModel):
name = db.StringProperty()
cumulative_avg = db.FloatProperty()
cumulative_count = db.IntegerProperty()

def __eq__(self, other):
if isinstance(other, Item):
return self.key() == other.key()
def __hash__(self):
return self.key().__hash__()

class ImgItem(Item):
imgurl = db.StringProperty()
crawl=db.ReferenceProperty(Crawl)
pic=db.ReferenceProperty(Picture,default=None)
style=db.ReferenceProperty(Style)
style_override=db.BooleanProperty()
price=db.FloatProperty()
link=db.LinkProperty()
about = db.TextProperty()
lastUpdate=db.DateTimeProperty(default=None)
merchant = db.ReferenceProperty(Merchant)

class Merchant(BaseModel):
name= db.StringProperty()

Thanks,

Paul.

On Jan 12, 3:05 pm, Marzia Niccolai ma...@google.com wrote:
 Hi,

 What is the model definition for Item?

 -Marzia



 On Mon, Jan 12, 2009 at 2:58 PM, Paul pwid...@gmail.com wrote:

  Am i doing something crazy or should i report this as a bug?

  On Jan 9, 6:45 pm, Paul pwid...@gmail.com wrote:
  I have a GQL query that works fine when theres only one Merchant
  Entity, but fails as below when theres more than 1, any ideas?

  merchantList= [e.key() for e in Merchant.all().fetch(10)]

  Item.gql('WHERE style = :style and merchant in :merchants ORDER BY
  __key__',style=theStyle,merchants=merchantList)

    846.     entities = query.fetch(numItems)
  File /home/paul/projects/outfitsis/.google_appengine/google/appengine/
  ext/db/__init__.py in fetch
    1377.     raw = self._get_query().Get(limit, offset)
  File /home/paul/projects/outfitsis/.google_appengine/google/appengine/
  ext/db/__init__.py in _get_query
    1659.     return self._proto_query.Bind(self._args, self._kwds)
  File /home/paul/projects/outfitsis/.google_appengine/google/appengine/
  ext/gql/__init__.py in Bind
    256.         query.update(enumerated_query)
  File /home/paul/projects/outfitsis/.google_appengine/google/appengine/
  api/datastore.py in update
    1036.       self.__setitem__(filter, value)
  File /home/paul/projects/outfitsis/.google_appengine/google/appengine/
  api/datastore.py in __setitem__
    979.     datastore_types.ValidateProperty(' ', value,
  read_only=True)
  File /home/paul/projects/outfitsis/.google_appengine/google/appengine/
  api/datastore_types.py in ValidateProperty
    1066.           'Unsupported type for property %s: %s' % (name,
  v.__class__))

  Exception Type: BadValueError at /design/
  Exception Value: Unsupported type for property  : class
  'food.models.Merchant'

  Running appengine_1.1.7
--~--~-~--~~~---~--~~
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 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Retrieving latest revision of a document

2009-01-12 Thread Ecir Hana

Ok, I'll go with the first model. Thanks for the reply!

On Jan 13, 12:53 am, Alexander Kojevnikov alexan...@kojevnikov.com
wrote:
 The first variant is faster while the second one requires less
 maintenance if you rename your documents a lot. Both will do the job.

 I'd use the first, de-normalised model unless you normally have a lot
 of revisions per document, modify the common document meta-data quite
 often, and the meta-data itself is large (in terms of the number of
 bytes or the number of properties stored).

 On Jan 13, 10:33 am, Ecir Hana ecir.h...@gmail.com wrote:

  Hello,
  what is the preferred way of retrieving the latest revision of a
  document?
  (The 'name' doesn't change across the revisions.)

  1:
  class Document(db.Model):
    name = db.StringProperty()
    revision = db.IntegerProperty()
    content = db.TextProperty()

  latest = Document.all().filter('name =', some_name).order('-
  revision').get()

  2:
  class Document(db.Model):
    name = db.StringProperty()

  class Revision(db.Model):
    document = db.ReferenceProperty(Document,
  collection_name='revisions')
    revision = db.IntegerProperty()
    content = db.TextProperty()

  document = Document.all().filter('name =', some_name).get()
  latest = document.revisions.order('-revision').get() [1]

  3:
  something different altogether?

  [1] Is it ok to call .get() for the second time?

  Thanks in advance!
--~--~-~--~~~---~--~~
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 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] ifequal and filters, not working

2009-01-12 Thread Elvis

Wery strange!

I try to use ifequal with filters and it dosent work

i search around web and found this is a normal

but in october ive write very similar code and it working! i lost my
working code and now try to rewite

in appengine i cant use {% with ... %} because it dosent exists

what you doif you need functionality like that:

{% ifequal date|date:¨n¨ enddate|date:¨n¨ %}
 do some
{% else %}
do some another
{% endifequal %}

any ideas^how to do it in templates?

--~--~-~--~~~---~--~~
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 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: user login URLs in html/javascript

2009-01-12 Thread djidjadji

Do you use (Django) templates?
If not start using them, separate the function (code) from the
presentation (html)

Read the GAE example

http://code.google.com/appengine/docs/gettingstarted/templates.html

There they show you how to use the
users.create_logout_url()
users.create_login_url()
methods in templates, read the Django doc about templates for version
0.96 for more things you can do.

2009/1/12 thebrianschott schott.br...@gmail.com:

 Geoffrey,

 It is not my desire to hardcode the urls, but I don't know how not to;
 my programming skills are limited. Or maybe I have not understood the
 suggests given here by you folks about how to do it in a way that is
 not hardcoded.

 The path a user takes in my application depends on whether s/he is
 logged in or not, and if logged in, whether s/he goes to a map s/he
 created or not. If a person has a google account, s/he may not want to
 use the app as if s/he does, because s/he will see different results
 from her/his users.

 On top of that, the users only interface with the app is via html
 pages, not python pages, so I don't know how to put links that change
 or appear and disappear according to user responses, into an html
 page. If I were to wait to ask the user about his/her logging
 preference at key times while the python program is in control, that
 would be ok, but I don't know how to do that in a way that keeps the
 html page visible in the background the way a javascript confirm
 dialog produces a little popup dialog window; that's my first choice,
 but I don't know how.

 My inclination is more toward developing another related app now, but
 I would be pleased to learn how to code a softcoded link if you or
 others can explain it to me.

 Thanks very much for expressing your question.


 On Jan 12, 12:11 pm, Geoffrey Spear geoffsp...@gmail.com wrote:

 You still almost certainly want your app to dynamically generate the
 links at runtime; I don't believe there's any guarantee that these
 hardcoded links will keep working if Google changes the login system,
 and the users API specifically includes functions that return the
 correct URLs so you don't have to hardcode them.

 I'm not sure why you think hardcoding in the link rather than
 generating it at runtime has anything to do with the ability to not
 require people to click it.  It still just shows up as a link on a
 webpage.

 Brian in Atlanta
 


--~--~-~--~~~---~--~~
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 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: What is the fastest way to check if an item is in the datastore?

2009-01-12 Thread Dan Sanderson
If you don't need the entity, count(1) would be faster than fetch(1) or
get().
-- Dan

On Mon, Jan 12, 2009 at 12:54 PM, SM sanja...@gmail.com wrote:



 I have a simple model like this:

 class MyModel(db.Model):
  prop = db.StringProperty()
  active = db.BooleanProperty(default=False)

 Given an input string, s, I'd like to know if it is in the datastore.
 Would this be the best way to check?

 if MyModel.gql(WHERE prop = :1 AND active = True, s).fetch(1):
  print Found
 else:
  print Not found

 Is there a faster/better way? Do I need to do anything with indexes to
 make this query better?

 


--~--~-~--~~~---~--~~
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 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Global Time Synchronisation Guarantees

2009-01-12 Thread djidjadji

You have no knowledge when your request is executed on the server.
Launching a new interpreter takes time, the server is busy processing
other requests. If the time of the data is important you should take a
time measurement at the sensor and send it as part of the request

2009/1/12 Cesium cesiumpic...@gmail.com:
 My application requires a time stamp from GAE that differs from
 UTC by no more than 1s. (I'll worry about latencies.)
 Imagine for example, a global network of sensors that measure
 geophysical data. The usefulness of the data is degraded if there
 is a large uncertainty surrounding the sample epoch (timestamp).

--~--~-~--~~~---~--~~
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 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Verification - what format will be accepted

2009-01-12 Thread bannerdyne

Hi Alexander,

thanks for your reply. I'll try this.

Sorry about the multiple posts - a computer glitch.

cheers



On Jan 13, 10:25 am, Alexander Kojevnikov alexan...@kojevnikov.com
wrote:
 This format worked for me: +61 4xx xxx xxx

 It looks like you are including a leading '0' after the country code,
 try removing it.

 See also this thread:http://is.gd/fBro

 On Jan 12, 10:02 pm, bannerdyne derek.new...@bannerdyne.com wrote:

  Hi,

  I am using a supported carrier in Australia. I cannot get my mobile
  number to be accepted.

  The message I get is:

  There were errors:     * Mobile Number or Username

  Is there a special format I need to use?

  This is the format I am using. Any help would be appreciated.

  61  000 000

  Thanks
--~--~-~--~~~---~--~~
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 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Format for Australian verification? Getting error.

2009-01-12 Thread bannerdyne

Sorry about the multiple posts - i had a computer glitch causing me to
post several times.

Please delete this one if required.

On Jan 13, 12:15 am, bannerdyne derek.new...@bannerdyne.com wrote:
 Hi,

 I am using a supported Australian carrier but am getting the following
 error when I try to verify.

 There were errors: * Mobile Number or Username

 I am using the following format 61  000 000. I have tried removing
 spaces, adding + symbol.

 Can you please tell me what the format for an Australian number should
 be?

 Thanks
--~--~-~--~~~---~--~~
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 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: What is the fastest way to check if an item is in the datastore?

2009-01-12 Thread SM

Thank you to everyone for the responses.

If I understand correctly, for my exampe I should use

if MyModel.gql(WHERE prop = :1 AND active = True, s).count(1):
  print Found
else:
  print Not found


On Jan 12, 5:52 pm, ryan ryanb+appeng...@google.com wrote:
 +1 to the responses.

 just to clarify, for the purposes of the archives. in case there's
 confusion between the two get() methods: Model.get()/db.get() are
 generally the fastest, modulo the size of the entity. Query.count(1)
 will be in the same ballpark, usually a little slower, but faster if
 the entity is big. Query.get(), and Query.fetch(1) are slower still,
 and basically the same.
--~--~-~--~~~---~--~~
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 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: What is the fastest way to check if an item is in the datastore?

2009-01-12 Thread kang
you get it

On Tue, Jan 13, 2009 at 10:30 AM, SM sanja...@gmail.com wrote:


 Thank you to everyone for the responses.

 If I understand correctly, for my exampe I should use

 if MyModel.gql(WHERE prop = :1 AND active = True, s).count(1):
   print Found
 else:
  print Not found


 On Jan 12, 5:52 pm, ryan 
 ryanb+appeng...@google.comryanb%2bappeng...@google.com
 wrote:
  +1 to the responses.
 
  just to clarify, for the purposes of the archives. in case there's
  confusion between the two get() methods: Model.get()/db.get() are
  generally the fastest, modulo the size of the entity. Query.count(1)
  will be in the same ballpark, usually a little slower, but faster if
  the entity is big. Query.get(), and Query.fetch(1) are slower still,
  and basically the same.
 



-- 
Stay hungry,Stay foolish.

--~--~-~--~~~---~--~~
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 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Unable to delete Indices

2009-01-12 Thread Gipsy

How can I delete my unwanted indices ?.
I've tried appcfg.py vacuum_indexes  and it said everything deleted
successfully.  But dashboard still says that i am exceeding indices
count quota. And the indices are in Building status.

Please help.



--~--~-~--~~~---~--~~
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 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] how to connect two pc?

2009-01-12 Thread jasmine infenta
FOR OUR PROJECT,WE NEED TO CONNECT TWO PC USING A LAN CABLE AND  FROM ONE
PC,WE SHD BE ABLE TO ACCESS THE FILES STORED ON THE OTHER  PC WITHOUT USING
IPADDRESS. IS  IT POSSIBLE? IF SO HOW?PLEASE DO REPLY US..

--~--~-~--~~~---~--~~
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 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---