[google-appengine] Modeling Article Error

2008-12-31 Thread dave...@gmail.com

I'm not sure if this is big enough to be posted in the issue tracker,
but I noticed a small coding mistake when I was reading the Datastore
Modeling article at http://code.google.com/appengine/articles/modeling.html

Right at the bottom of the "One to Many" section, is the following
paragraph followed by a line of code:

"When Scott loses his phone, it's easy enough to delete that record.
Just delete the PhoneNumber instance and it can no longer be queried
for:"

jack.phone_numbers.filter('phone_type =', 'home').get().delete()

Shouldn't the line of code be:

scott.phone_numbers.filter('phone_type =', 'home').get().delete()
--~--~-~--~~~---~--~~
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: NeedIndexError and dynamically created entities

2008-12-31 Thread Elias Athanasopoulos

Hello!

On Dec 31, 2:15 am, Marzia Niccolai  wrote:
> Hi Elias,
>
> You only need indexes for certain kinds of queries, such as those with
> inequality filters, or some ancestor queries.  You can run other queries
> immediately after a kind is created. Composite index queries can be read up
> on here:http://code.google.com/appengine/docs/datastore/queriesandindexes.html
> Also, this article is very 
> helpful:http://code.google.com/appengine/articles/index_building.html
>
> If you create a kind you believe will need a composite index, you might try
> to log the kind and query type, and periodically add those to your
> app.yaml.  Please also be aware that there is currently a limit on 100
> composite indexes per application.

Yes, I understand, but the thing is that the query is exactly the same
for all dynamically created kinds. For example, it is in the fashion:

query = "SELECT * FROM %s WHERE..." % user_table()

The only thing that is changing is the kind name. Everything else is
the same. Is there anything I can do to tell App Engine to use the
index of an already indexed query or some similar hack?

Regards,
Elias
--~--~-~--~~~---~--~~
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: NeedIndexError and dynamically created entities

2008-12-31 Thread Paul Kinlan

Hi,

I created an issue about programmatic access to an index managment api  
the other month because I have similar problems.  I am on my phone at  
the moment so I can't remember the URL of the issue.  But star it if  
you agree, it is named Index Managment API or something similar.

Regards
Paul Kinlan



On 31 Dec 2008, at 10:55, Elias Athanasopoulos  wrote:

>
> Hello!
>
> On Dec 31, 2:15 am, Marzia Niccolai  wrote:
>> Hi Elias,
>>
>> You only need indexes for certain kinds of queries, such as those  
>> with
>> inequality filters, or some ancestor queries.  You can run other  
>> queries
>> immediately after a kind is created. Composite index queries can be  
>> read up
>> on 
>> here:http://code.google.com/appengine/docs/datastore/queriesandindexes.html
>> Also, this article is very 
>> helpful:http://code.google.com/appengine/articles/index_building.html
>>
>> If you create a kind you believe will need a composite index, you  
>> might try
>> to log the kind and query type, and periodically add those to your
>> app.yaml.  Please also be aware that there is currently a limit on  
>> 100
>> composite indexes per application.
>
> Yes, I understand, but the thing is that the query is exactly the same
> for all dynamically created kinds. For example, it is in the fashion:
>
> query = "SELECT * FROM %s WHERE..." % user_table()
>
> The only thing that is changing is the kind name. Everything else is
> the same. Is there anything I can do to tell App Engine to use the
> index of an already indexed query or some similar hack?
>
> Regards,
> Elias
> >

--~--~-~--~~~---~--~~
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: Getting malformed or illegal request from google staticmap

2008-12-31 Thread bFlood

I think you might need to remove the map api key from the urlencode
call and then just add it to the url manually afterwards. encoding
might be changing the key value

cheers
brian

On Dec 30, 11:21 pm, nicklv  wrote:
> Hi,
>
> I notice GAE includes a "referer" property into the header when
> sending a fetch request mapsapi.
> Could this be the reason why maps api is returning malformed/illegal
> requests?
>
> On Dec 31, 11:14 am, nicklv  wrote:
>
> > Hi,
>
> > I was wondering if anyone is fetching from staticmap from GAE?
> > I'm fetching from google staticmap and getting malformed or illegal
> > request reply.
>
> > Below is a snippet of my code. My only guess is that it could be a
> > problem with
> > the api key - it contains '-'. Should I escape it?
>
> > Appreciate anyone could show some pointers.
>
> > urlfields = { 'center': str(rlat) + ',' + str(rlon),
> >                           'zoom' : str(defzoom),
> >                           'size' : str(defsize) + 'x' + str(defsize),
> >                           'maptype': 'mobile',
> >                           'key': mapapikey,
> >                           'sensor': 'false',
> >                           'markers': str(rlat) + ',' + str(rlon)
> >                }
> > url = server+ urllib.urlencode(urlfields)
> > imagemap = urlfetch.fetch(url)
> > if imagemap.status_code == 200:
> >                 self.response.headers['Content-Type'] = 'image/gif'
> >                 self.response.out.write(imagemap.content)
> > else:
> >                 logging.debug('Response code != 200')
> >                 self.response.headers['Content-Type'] = 'text/html'
> >                 self.response.out.write(imagemap.content)
--~--~-~--~~~---~--~~
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: Flex 3 parse xml string from Model.to_xml() Error

2008-12-31 Thread Tony



On Dec 30, 8:58 pm, Ishmael  wrote:
> I ended-up building my own "xml_to_array()" function. turned out to be
> rather easy because the model.to_xml() uses such a nice and compact
> schema. what language are you using? my function is in PHP if you want
> me to post it. otherwise I think you'll be hard pressed to find a
> generic utility function that is built to handle GData types.
>
> On Dec 29, 7:51 am, Tony  wrote:
>
> > I am implementing an app, Flex 3 as the GUI via pyamf.
>
> > In a response, return a string by calling model.to_xml() and parse
You are so nice.
I am using actionscript 3.0 to handle the xml returned from gae.
I think gae is lacking a clear documentation.
I even don't how to get back the value from
a db.Email object . So that I want just to xml()
to get the value and for further handling.
I know a bit php. I would be very graceful if you
give me your php source code and can you tell
me how to handle db.Email object in python?

Thank you.

> > the result in flex 3, var data:XML = new XML(resultStr);
>
> > It raised a exception
> > "TypeError: Error #1083: The prefix "gd" for element
> > "gd:postalAddress" is not bound."
>
> > Who can tell me that how can I parse the xml ? Thank you
--~--~-~--~~~---~--~~
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: Send and receive mail with embedded images

2008-12-31 Thread Daniel Levin
It's done:

http://code.google.com/p/googleappengine/issues/detail?id=965

Thanks all

Daniel Levin


On Mon, Dec 22, 2008 at 9:27 PM, Alexander Kojevnikov <
alexan...@kojevnikov.com> wrote:

>
> Daniel, please post here the link when you submit it, I will
> definitely star the issue.
>
> On Dec 23, 4:13 am, Marzia Niccolai  wrote:
> > Hi,
> >
> > Feature requests can be filed here:
> http://code.google.com/p/googleappengine/issues/list
> >
> > -Marzia
> >
> > On Mon, Dec 22, 2008 at 4:43 AM, Daniel Levin 
> wrote:
> > > Jeff,
> > >First of all, thank!
> > >   Last thing from this topic: Where should I submit my feature request?
> >
> > > REGARDS!
> > > Daniel Levin
> >
> > > On Thu, Dec 18, 2008 at 5:59 PM, Jeff S  wrote:
> >
> > >> Hi Daniel,
> >
> > >> It seems inline attachments with Content ID and MIME Multipart/Related
> > >> Content is not supported in the current mail API, but I think it would
> > >> be a good idea to file this as a feature request.
> >
> > >> Happy coding,
> >
> > >> Jeff
> >
> > >> On Dec 17, 1:55 pm, Jeff S  wrote:
> > >> > Ah I see. I'm not sure how to do this using the App Engine mail API
> > >> > either, I'll ask around.
> >
> > >> > Thank you,
> >
> > >> > Jeff
> >
> > >> > On Dec 17, 11:41 am, "Daniel Levin"  wrote:
> >
> > >> > > Alexander,
> > >> > >  Yes, I do refer to the that method (inline attachment using CID).
> I
> > >> did it
> > >> > > before with PHP without any problem, very easy. Now I want to
> migrate
> > >> to
> > >> > > Google App Engine, and I don't see how to implement that.
> >
> > >> > >Any idea?
> >
> > >> > > Regards,
> > >> > > Daniel Levin
> >
>

--~--~-~--~~~---~--~~
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] Memcache Question

2008-12-31 Thread Toney

I'm optimizing my code to use memcache, can anyone tell me the
difference between using memcache like this...

memcache.add(key="Registration'+users.get_current_user()",
value=query, time=3600)

versus this way...

memcache.add('Registration'+users.get_current_user(), query

I found one way while watching the building-scalable-web-applications-
with-google-app-engine video and the other in the memcache
documentation.

I'm thinking the second example appends data to the memcachce key and
the first replaces what's in the specific memcache key with the new
value.  or is there no difference??
--~--~-~--~~~---~--~~
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 Application Configuration Data

2008-12-31 Thread Tony Arkles



On Dec 30, 6:13 pm, "James Leskovar"  wrote:
> If you don't specify an expiry time, they'll persist  
> forever, until
> there's significant load on the cache.

This is really important to note: if you're using the memcache for
your application settings, you probably want it to be backed by a
datastore entity -- don't just store the settings in the memcache, or
you'll randomly lose them and revert back to your defaults.

--~--~-~--~~~---~--~~
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: are numeric ids of deleted entities reused?

2008-12-31 Thread Andy Freeman

> good question! per-entity-group id namespaces currently live forever.
> if all of the entities in a given entity group disappear, and then the
> entity group later reappears, ids for new entities in that group will
> not be reused.

If I never allocate ids within a given entity-group namespace, does
anything for that namespace live forever (after all entities in said
group have been deleted)?

I ask because I'm creating lots of entity groups with multiple
entities where every below-root entity has an explicit name.  (In
other words, I'm not creating any entities that have ids within these
groups.)  These entity groups don't last very long and I never reuse a
given entity group name (the root class name and its unique name).

The total number of such groups that have entities at any given time
is fairly modest, but the total number that has existed over the life
of the application can be fairly large.  Thus, if any information
about these groups "live[s] forever", I may have a problem.

> this is another implementation detail, though, not a hard guarantee!

Thanks for the information.  I'm clearly surprised that any
information "live[s] forever" as I assumed that most applications that
use entity groups would not reuse their namespaces.


On Dec 30, 5:36 pm, ryan  wrote:
> On Dec 20, 11:14 pm, Thomas Johansson  wrote:
>
>
>
> > Is this to be interpreted as getting the following, in order, more or
> > less? (where the ID/Key is in square brackets)
>
> > /Image[42]
> > /Image[127841]
>
> > /Thread[10]/Post[42]
> > /Thread[10]/Post[127841]
>
> > E.g. the ID is ever increasing, but only for the current fully
> > qualified path?
>
> correct.
>
> > Can we ever experience inserting a record that will have a lower ID than the
> > previous?
>
> the others beat me to this answer. :P if the rest of the path is
> identical, then it's uncommon, but definitely possible.
>
> > Forgot to ask; How does the key fit into the hierarchy, compared to
> > the key_name & id?
>
> i'm not sure i understand this question. a key is composed of app id
> and the full path to the entity. key names and ids are components of
> paths. feel free to follow up if that doesn't answer the question.
>
> On Dec 23, 10:44 am, Andy Freeman  wrote:
>
> > That's a curious comment.  It suggests that ids may be reused if
> > there's another difference in the path.
>
> correct. for example, each of these keys is valid and points to a
> distinct entity:
>
> /Post[1]
> /Post[1]/Post[1]
> /Post[1]/Post[1]/Post[1]
> /Post[1]/Thread[1]
> /Thread[1]
> /Thread[1]/Post[1]
> /Thread[1]/Post[1]/Thread[1]/Post[1]
> /Thread[1]/Post[1]/Post[1]/Thread[1]
>
> > However, combining that with the statement that there's no reuse for a
> > given path is interesting because there's no obvious place for the
> > datastore to keep track of what ids it has used.
>
> under the covers, each entity group has its own id namespace that's
> used for non-root entities. root entities have their own per-app id
> namespace. both namespaces are independent of kind and path
> hierarchies (apart from the root entities, since they define entity
> groups).
>
> that means that in practice, every id-based root entity has an id
> that's across all other root entities, and every id-based non-root
> entity has an id that's unique across all other entities in that
> entity group.
>
> this is all just implementation details, though! we don't have any
> plans to change id allocation right now, and it's unlikely that we
> will, but the only hard uniqueness guarantee we provide is that the
> full path is unique.
>
> the upshot of all of this is that you generally want to use full keys
> whenever possible. bare ids or key names are generally only
> interesting or useful when the rest of the path is held constant,
> including the kind of the entity in question. that's the only way to
> guarantee the key names or ids will be unique.
>
> > Yes, one can store an indicator of what ids have been used (such as
> > the last id used) with an entity group, but what happens to that
> > indicator when the entity group goes away?  If it is destroyed and
> > then recreated when the entity group is recreated, how does the id
> > allocator avoid previously used ids?
>
> good question! per-entity-group id namespaces currently live forever.
> if all of the entities in a given entity group disappear, and then the
> entity group later reappears, ids for new entities in that group will
> not be reused.
>
> this is another implementation detail, though, not a hard guarantee!
--~--~-~--~~~---~--~~
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: Database wrapper for datastore

2008-12-31 Thread Tony Arkles

I don't mean to be pessimistic, but in my experience so far, using
"relational ideas" with the datastore pretty much results in queries
that consume way too much CPU time (because it involves too many
datastore hits).  Data modelling using the datastore is quite
different than normal relational modelling, and trying to adapt it
will likely just (slightly) delay the inevitable.

On Dec 30, 8:07 pm, adelevie  wrote:
> I am wondering if there is any interest in some sort of wrapper for
> the datastore with other object relational mappers. Such wrappers
> would make it easier to transition between GAE and other databases--
> just change some db settings. For example, while GAE is compatible
> with Django (.96), you must change all of your database models and
> queries. I understand that BigTable is not a relational databse,
> however it can be used somewhat relationally via its ReferenceProperty
> ().
> Does anyone else want this? Is it even technically possible/practical?
>
> Thanks,
> Alan
--~--~-~--~~~---~--~~
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: App works once per session

2008-12-31 Thread Tom

The problem was a variable with an old value.  Thanks for the
suggestions.

On Dec 26, 12:11 pm, Tom  wrote:
> Thanks.  I am using app-engine-patch so perhaps something in there has
> globals.  All of my code is contained in 'def's with no globals.
>
> On Dec 26, 11:52 am, djidjadji  wrote:
>
> > I think ALL global variables in your code are maintained when the
> > session is reused.
>
> > 2008/12/26 Tom :
>
> > > My app works once and then stops.  I'm remote at the moment and so my
> > > debug capabilities are limited but it seems like there is something
> > > persistent about my calls to GAE.  Is there anything in the dashboard
> > > that would let me see if an app session was being reused?  I was under
> > > the impression that each POST call to GAE is its own entity.  What
> > > persistent info is maintained between calls if the session is reused?
> > > (I don't use memcache.)
>
> > > Any pointers or insights greatly appreciated!
> > > Tom
--~--~-~--~~~---~--~~
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] lower case string query

2008-12-31 Thread Ray Malone

I can't seem to find documentation on how to filter a string value and
expect a lower case value.  For example if users input their names in
upper and lower case I want to find the value using a lower case value
later.
--~--~-~--~~~---~--~~
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] entity.populate()

2008-12-31 Thread Rodrigo Moraes

Hey,
I am missing a way to populate an entity with data from a dict (or a
list of tuples with key/value). We can do this with new entities:

entity = ModelFoo(**data)

... but how about existing entities? Wouldn't a populate() (or load(),
or call it a better name :-) Something like:

entity = ModelFoo.get_by_id(id)
entity.populate(data)

It's pretty simple, and I am wondering if it would not be worth to
have in Molel:

def populate(self, data):
properties = self.properties()
for key, value in data.iteritems():
if key in properties:
setattr(self, key, value)

... or: maybe I am missing a feature that already exists?

thank you,
rodrigo

--~--~-~--~~~---~--~~
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: lower case string query

2008-12-31 Thread Rodrigo Moraes

On Wed, Dec 31, 2008 at 1:27 PM, Ray Malone wrote:
> I can't seem to find documentation on how to filter a string value and
> expect a lower case value.  For example if users input their names in
> upper and lower case I want to find the value using a lower case value
> later.

You'd need to store a copy of the name in lowercase, so that you can
filter by it.

-- rodrigo

--~--~-~--~~~---~--~~
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] why java

2008-12-31 Thread Aramaki

Hi, a few months ago I started with python to get used to GAE. Before
that, I was working with java and it is still a language that I
appreciate.

But the fact is that after learning python I really don't see the
advantage. My point is that python is strong enough to gracefully
carry out almost any task conceived for GAE. It is fully OOP and
strong enough. I use my eclipse like always so my question is guys:

- The comunity interest in implementing java will give you so much
advantage or it is because you do no want to learn python
--~--~-~--~~~---~--~~
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

2008-12-31 Thread Xavier Mathews

There Are So many Javas Out there to learn that its really up to the
user!  Python is not really used anymore. But its nice to still know
it!

On 12/31/2008, Aramaki  wrote:
>
> Hi, a few months ago I started with python to get used to GAE. Before
> that, I was working with java and it is still a language that I
> appreciate.
>
> But the fact is that after learning python I really don't see the
> advantage. My point is that python is strong enough to gracefully
> carry out almost any task conceived for GAE. It is fully OOP and
> strong enough. I use my eclipse like always so my question is guys:
>
> - The comunity interest in implementing java will give you so much
> advantage or it is because you do no want to learn python
> >
>


-- 
Xavier A. Mathews
Student/Browser Specialist/Developer/Web-Master
Client Based Tech Support Specialist
Hazel Crest Illinois
xavieruni...@gmail.com¥xavierunited@hotmail.com¥truestar...@yahoo.com
"Fear of a name, only increases fear of the thing itself."

--~--~-~--~~~---~--~~
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

2008-12-31 Thread Rodrigo Moraes

On Wed, Dec 31, 2008 at 2:09 PM, Xavier Mathews wrote:
> There Are So many Javas Out there to learn that its really up to the
> user!  Python is not really used anymore. But its nice to still know
> it!

What do you mean by "Python is not really used anymore"?

-- rodrigo

--~--~-~--~~~---~--~~
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: Memcache Question

2008-12-31 Thread djidjadji

There is NO difference, only the first names the individual arguments,
you can call
memcache.add(time=3600, value=query
,key="Registration'+users.get_current_user()" )
and get the same result.
The second versions uses the position of the arguments.

I noticed some strange things with the quotes, single and double, are
they exactly as given in the examples?
users.get_current_user() returns a User object, this might not work
very well in adding to a String unless Python calls the __str__()
method on the User object because we try to add to a string.

2008/12/31 Toney :
>
> I'm optimizing my code to use memcache, can anyone tell me the
> difference between using memcache like this...
>
> memcache.add(key="Registration'+users.get_current_user()",
> value=query, time=3600)
>
> versus this way...
>
> memcache.add('Registration'+users.get_current_user(), query
>
> I found one way while watching the building-scalable-web-applications-
> with-google-app-engine video and the other in the memcache
> documentation.
>
> I'm thinking the second example appends data to the memcachce key and
> the first replaces what's in the specific memcache key with the new
> value.  or is there no difference??
> >
>

--~--~-~--~~~---~--~~
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: Do I need to escape "?" character when writing html code?

2008-12-31 Thread boson

It's not really clear what you're trying to do.  You have "+str(loct)
+" in a URL.  Is that supposed to be evaluated by JavaScript in the
browser?  If you post a larger snippet of your issue it might help
explain your problem.

On Dec 29, 7:59 pm, nicklv  wrote:
> Hi,
>
> I'm using self.response.out.write(template.render(path,
> template_values))
> to write some html code out. In the html code, I have the following
>
>  'http://maps.google.com/staticmap?center='+str(loct)+","+str(loc)
> +"&zoom=13&size=400x400&maptype=mobile&key=MAPS_API_KEY&sensor=true_or_fals 
> e&markers="+str
> (loct)+","+str(loc)+",blue"
>
> But when I load into the browser, the browser will not show the image
> from the above code.
> I notice there is sort of a line-break after "staticmap?". I'm
> suspecting the question mark "?" is causing some problem.
>
> Do I need to escape the question mark for the code to work correctly?
>
> 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 do you debug?

2008-12-31 Thread boson

Antonin, on behalf of the community, thanks for your great
contributions!

For what it's worth (and in the absence of more formalized tools),
I've always found logging to be an effective means of debugging when
used *intelligently*.  The "logging" module combined with Python's
"repr" function are quite handy.

import logging

logging.info("bout to change obj: %s" % repr(obj))
# do stuff
logging.info("changed obj: %s" % repr(obj))

After you get your trouble spot ironed out, just delete the logging
code (or clean it up into something that might be useful for later,
and change .info to .debug, etc.).


On Dec 30, 7:57 am, Antonin Hildebrand 
wrote:
> Hello,
> I'm new to Python, I've started with Python approx 5 months ago
> because of GAE. Promising platform, but when I started, I was unhappy
> with the state of the tools around GAE and Python in general.
>
> For log inspection I've created 
> FirePython:http://github.com/darwin/firepython/tree/master
>
> FirePython I use all the time with GAE and it is a life saver for me.
>
> ---
> For debugging I've tried almost all free tools
> * Eclipse+pydev (too bloated and slow to start the IDE),
> * WinPdb (not polished, password protection when attaching debug
> session drives me crazy),
> * Komodo (unable to setup debugger with GAE SDK),
> ...
> * I'm looking forward to Netbeans Python support in next version
>
> Nothing satisfied me, mainly because I wanted to stay with my favorite
> code editor (TextMate) during debug sessions and not starting some
> bloated IDE.
>
> I've ended using old pdb in terminal. Unfortunately I was unable to
> setup code completion at least. I've tried to mess with pdb sources,
> but it felt to me like bunch of crap and without debugger to debug it
> I was quite lost :-)
>
> I was so frustrated, that I've written my own debugger shell on top of
> pdb in terminal window. Nicely integrated with TextMate using script
> called PdbTextMateSupport.
> Here is a screenshot:http://public.hildebrand.cz/termate_and_pdb.png
>
> I'm quite new to OSX. I've taken this as a training. I've learned
> MacRuby + Cocoa and have written this terminal sniffer in Ruby. This
> debugger shell has less than 1000 LOC and does just bare minimum. I've
> created TextMate bundle for keyboard shortcut to step the code.
>
> It has some rough edges, but I'm quite happy with this solution. It
> works for me, but it is not public ready. Basicaly it is just a
> weekend hack. I have no extra energy to make this into proper open-
> source project with decent support.
>
> If you are interested in sources 
> ...http://github.com/darwin/termite.pdb/tree/master
>
> Fork it or leave it :-)
>
> Best wishes for 2009 and hope for better tools for Python and GAE.
> Antonin
>
> On Dec 29, 12:04 am, Chen Harel  wrote:
>
> > Does anyone here have a simple way to breakpoint your code?
> > I saw a tutorial for PyDev in Eclipse, but what about simpler IDE such
> > as ActivePython?
--~--~-~--~~~---~--~~
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 do you debug?

2008-12-31 Thread Antonin Hildebrand

Dan, you are right that logging may be productive in many cases.

But there are other cases when logging just doesn't work. For example
I have some library code and I want to learn how it works. Or my code
is called by library code and I want to know what is going on  here,
e.g. who has called me. I don't want to modify library sources and
just looking at sources is not sufficient, because of dynamic nature
of scripting languages. I need to be able to break, see the  callstack
and step through code.

Other issue is unstructured nature of log messages. If I dump object
structure with repr or str, I get poorly formated soup of members. It
is hard to read and sometimes you would like to drill down the
structure, which is not possible with dumb log strings.

Maybe I'm a little bit biased, I'm coming from Microsoft Visual Studio
world, where debuggers were always on very high level.

On Wed, Dec 31, 2008 at 7:47 PM, boson  wrote:
>
> Antonin, on behalf of the community, thanks for your great
> contributions!
>
> For what it's worth (and in the absence of more formalized tools),
> I've always found logging to be an effective means of debugging when
> used *intelligently*.  The "logging" module combined with Python's
> "repr" function are quite handy.
>
> import logging
>
> logging.info("bout to change obj: %s" % repr(obj))
> # do stuff
> logging.info("changed obj: %s" % repr(obj))
>
> After you get your trouble spot ironed out, just delete the logging
> code (or clean it up into something that might be useful for later,
> and change .info to .debug, etc.).
>
>
> On Dec 30, 7:57 am, Antonin Hildebrand 
> wrote:
>> Hello,
>> I'm new to Python, I've started with Python approx 5 months ago
>> because of GAE. Promising platform, but when I started, I was unhappy
>> with the state of the tools around GAE and Python in general.
>>
>> For log inspection I've created 
>> FirePython:http://github.com/darwin/firepython/tree/master
>>
>> FirePython I use all the time with GAE and it is a life saver for me.
>>
>> ---
>> For debugging I've tried almost all free tools
>> * Eclipse+pydev (too bloated and slow to start the IDE),
>> * WinPdb (not polished, password protection when attaching debug
>> session drives me crazy),
>> * Komodo (unable to setup debugger with GAE SDK),
>> ...
>> * I'm looking forward to Netbeans Python support in next version
>>
>> Nothing satisfied me, mainly because I wanted to stay with my favorite
>> code editor (TextMate) during debug sessions and not starting some
>> bloated IDE.
>>
>> I've ended using old pdb in terminal. Unfortunately I was unable to
>> setup code completion at least. I've tried to mess with pdb sources,
>> but it felt to me like bunch of crap and without debugger to debug it
>> I was quite lost :-)
>>
>> I was so frustrated, that I've written my own debugger shell on top of
>> pdb in terminal window. Nicely integrated with TextMate using script
>> called PdbTextMateSupport.
>> Here is a screenshot:http://public.hildebrand.cz/termate_and_pdb.png
>>
>> I'm quite new to OSX. I've taken this as a training. I've learned
>> MacRuby + Cocoa and have written this terminal sniffer in Ruby. This
>> debugger shell has less than 1000 LOC and does just bare minimum. I've
>> created TextMate bundle for keyboard shortcut to step the code.
>>
>> It has some rough edges, but I'm quite happy with this solution. It
>> works for me, but it is not public ready. Basicaly it is just a
>> weekend hack. I have no extra energy to make this into proper open-
>> source project with decent support.
>>
>> If you are interested in sources 
>> ...http://github.com/darwin/termite.pdb/tree/master
>>
>> Fork it or leave it :-)
>>
>> Best wishes for 2009 and hope for better tools for Python and GAE.
>> Antonin
>>
>> On Dec 29, 12:04 am, Chen Harel  wrote:
>>
>> > Does anyone here have a simple way to breakpoint your code?
>> > I saw a tutorial for PyDev in Eclipse, but what about simpler IDE such
>> > as ActivePython?
> >
>

--~--~-~--~~~---~--~~
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] Trying to understand model keys a little better

2008-12-31 Thread Ryan W

I was reading the article on Django Form Validation -
http://code.google.com/appengine/articles/djangoforms.html - and came
across using db.Key.from_path as a way to access a model instance.
But, I'm wondering if there's any real difference or preferred method
between these two approaches below?  If you have the key, why not just
use the stringified version of it directly instead of constructing the
key from its Id?

1)
Template: a href="item/edit?key={{ item.key }}"

Code:
key = self.request.get('key')
item = Item.get(db.Key(key))

2)
Template: a href="item/edit?id={{ item.key.id }}"

Code:
id = int(self.request.get('id'))
item = Item.get(db.Key.from_path('Item', id))


Any insight?
--~--~-~--~~~---~--~~
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: Blank Page when requesting site

2008-12-31 Thread Jose J

I found the answer at:

http://groups.google.com/group/google-appengine/browse_thread/thread/26721420de23709e/8a4d2d7523c810be?lnk=gst&q=blank+page#8a4d2d7523c810be

check for

if __name__ == '__main___':
  main()

and the end of your handler

--JJ

On Dec 29, 6:02 pm, Jose J  wrote:
> My apology for bringing up what might be a beginner question.  I am
> working on a new application and I occasionally get ablankpageon
> the first request for an application.  Theblankpageis completelyblank.  The 
> source of thepageisblankas well.  My application
> request log reports it as a 200, but does not request images, css,
> scripts, etc.    Thepageis notblankand, on a refresh, the log
> shows a request for all the files and the browser shows the fullpage.  Could 
> this be an issue with how my site is coded?  The homepagedoes not require 
> login.  The homepageis using a django
> template, but, like I said, the resultingpageis completelyblank,
> not ablanktemplate.
>
> My site works otherwise and I like the way it works.  I just don't
> understand what is happening when I get ablankpage.  Should I make
> my homepagea staticpage?  Would that help? or would the first codepagestill 
> require a refresh?  Is it because I have a template named
> Index.html at the root of my application?  I would think that it would
> be serving up the template without expanding the content if that was
> the issue.
>
> I did some searching and found one reference that was answered by
> someone who mentioned a caching delay on the GAE servers.  If that is
> the problem, how do others get around it?  (does your app just need to
> have enough users to avoid everyone seeing theblankpage?)
>
> Any help would be great.
>
> Thank you,
>
> --JJ
--~--~-~--~~~---~--~~
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: Trying to understand model keys a little better

2008-12-31 Thread Rodrigo Moraes

On Wed, Dec 31, 2008 at 5:21 PM, Ryan W wrote:
> If you have the key, why not just
> use the stringified version of it directly instead of constructing the
> key from its Id?

Maybe you would want to check if the key is valid - I think Key will
throw an exception if it is not. Apart that, it is cleaner and exact
the same to use the stringfied version - if you have it. Constructing
it from path may be useful in some cases when you have known ancestors
- remember that id is only unique for the same ancestor. Anyway,
sometimes it makes sense to build a key programaticaly - normally not.

-- rodrigo

--~--~-~--~~~---~--~~
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

2008-12-31 Thread Xavier Mathews

Well not many people developers etc use that form of java anymore kinda like c++

On 12/31/2008, Rodrigo Moraes  wrote:
>
> On Wed, Dec 31, 2008 at 2:09 PM, Xavier Mathews wrote:
>> There Are So many Javas Out there to learn that its really up to the
>> user!  Python is not really used anymore. But its nice to still know
>> it!
>
> What do you mean by "Python is not really used anymore"?
>
> -- rodrigo
>
> >
>


-- 
Xavier A. Mathews
Student/Browser Specialist/Developer/Web-Master
Client Based Tech Support Specialist
Hazel Crest Illinois
xavieruni...@gmail.com¥xavierunited@hotmail.com¥truestar...@yahoo.com
"Fear of a name, only increases fear of the thing itself."

--~--~-~--~~~---~--~~
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: Trying to understand model keys a little better

2008-12-31 Thread Ryan W

Thanks!  Just double checking I'm not missing anything important.

On Dec 31, 11:31 am, "Rodrigo Moraes" 
wrote:
> On Wed, Dec 31, 2008 at 5:21 PM, Ryan W wrote:
> > If you have the key, why not just
> > use the stringified version of it directly instead of constructing the
> > key from its Id?
>
> Maybe you would want to check if the key is valid - I think Key will
> throw an exception if it is not. Apart that, it is cleaner and exact
> the same to use the stringfied version - if you have it. Constructing
> it from path may be useful in some cases when you have known ancestors
> - remember that id is only unique for the same ancestor. Anyway,
> sometimes it makes sense to build a key programaticaly - normally not.
>
> -- rodrigo
--~--~-~--~~~---~--~~
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

2008-12-31 Thread luismgz

Uh?

On Dec 31, 4:45 pm, "Xavier Mathews"  wrote:
> Well not many people developers etc use that form of java anymore kinda like 
> c++
>
> On 12/31/2008, Rodrigo Moraes  wrote:
>
>
>
> > On Wed, Dec 31, 2008 at 2:09 PM, Xavier Mathews wrote:
> >> There Are So many Javas Out there to learn that its really up to the
> >> user!  Python is not really used anymore. But its nice to still know
> >> it!
>
> > What do you mean by "Python is not really used anymore"?
>
> > -- rodrigo
>
> --
> Xavier A. Mathews
> Student/Browser Specialist/Developer/Web-Master
> Client Based Tech Support Specialist
> Hazel Crest Illinois
> xavieruni...@gmail.com¥xavieruni...@hotmail.com¥truestar...@yahoo.com
> "Fear of a name, only increases fear of the thing itself."
--~--~-~--~~~---~--~~
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

2008-12-31 Thread Andrew Badera
If there are any computer books within reach in your mom's basement, perhaps
you should consider reading them. And maybe do work on a "real" project or
two or three ...




On Wed, Dec 31, 2008 at 2:45 PM, Xavier Mathews wrote:

>
> Well not many people developers etc use that form of java anymore kinda
> like c++
>
> On 12/31/2008, Rodrigo Moraes  wrote:
> >
> > On Wed, Dec 31, 2008 at 2:09 PM, Xavier Mathews wrote:
> >> There Are So many Javas Out there to learn that its really up to the
> >> user!  Python is not really used anymore. But its nice to still know
> >> it!
> >
> > What do you mean by "Python is not really used anymore"?
> >
> > -- rodrigo
> >
> > >
> >
>
>
> --
> Xavier A. Mathews
> Student/Browser Specialist/Developer/Web-Master
> Client Based Tech Support Specialist
> Hazel Crest Illinois
> xavieruni...@gmail.com¥xavierunited@hotmail.com¥truestar...@yahoo.com
> "Fear of a name, only increases fear of the thing itself."
>
> >
>

--~--~-~--~~~---~--~~
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: lower case string query

2008-12-31 Thread Ray Malone

I came up with the same approach, however, this is a unclean way to
handle it.  Is this the only option?

On Dec 31, 10:42 am, "Rodrigo Moraes" 
wrote:
> On Wed, Dec 31, 2008 at 1:27 PM, Ray Malone wrote:
> > I can't seem to find documentation on how to filter a string value and
> > expect a lower case value.  For example if users input their names in
> > upper and lower case I want to find the value using a lower case value
> > later.
>
> You'd need to store a copy of the name in lowercase, so that you can
> filter by it.
>
> -- rodrigo
--~--~-~--~~~---~--~~
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

2008-12-31 Thread Xavier Mathews

What was the point of that?

On 12/31/2008, Andrew Badera  wrote:
> If there are any computer books within reach in your mom's basement, perhaps
> you should consider reading them. And maybe do work on a "real" project or
> two or three ...
>
>
>
>
> On Wed, Dec 31, 2008 at 2:45 PM, Xavier Mathews
> wrote:
>
>>
>> Well not many people developers etc use that form of java anymore kinda
>> like c++
>>
>> On 12/31/2008, Rodrigo Moraes  wrote:
>> >
>> > On Wed, Dec 31, 2008 at 2:09 PM, Xavier Mathews wrote:
>> >> There Are So many Javas Out there to learn that its really up to the
>> >> user!  Python is not really used anymore. But its nice to still know
>> >> it!
>> >
>> > What do you mean by "Python is not really used anymore"?
>> >
>> > -- rodrigo
>> >
>> > >
>> >
>>
>>
>> --
>> Xavier A. Mathews
>> Student/Browser Specialist/Developer/Web-Master
>> Client Based Tech Support Specialist
>> Hazel Crest Illinois
>> xavieruni...@gmail.com¥xavierunited@hotmail.com¥truestar...@yahoo.com
>> "Fear of a name, only increases fear of the thing itself."
>>
>> >
>>
>
> >
>


-- 
Xavier A. Mathews
Student/Browser Specialist/Developer/Web-Master
Client Based Tech Support Specialist
Hazel Crest Illinois
xavieruni...@gmail.com¥xavierunited@hotmail.com¥truestar...@yahoo.com
"Fear of a name, only increases fear of the thing itself."

--~--~-~--~~~---~--~~
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] Google App Engine Backup and Restore (Gaebar) - Beta 2 release

2008-12-31 Thread Aral

I just updated Gaebar to Beta 2.

This update has essential bug fixes so if you downloaded Beta 1,
please upgrade.

Also, your restores should now be much faster. :)

Announcement and more info in my blog post at:
http://aralbalkan.com/1837

Happy New Year!

Aral

--~--~-~--~~~---~--~~
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

2008-12-31 Thread warreninaustintexas

Programmers are human beings - even though we work with logic-oriented
problems.  We still have the natural human behavior of preferring
something familiar over something unfamiliar - even if the unfamiliar
environment is superior.  Java is familiar because it is the primary
language taught in universities and it is one of the most commonly
used languages in enterprise software.

>From a pure functionality standpoint, there is no reason to have Java
on Google App Engine.  App Engine is scalable from a system
architecture standpoint.  Google could just as easily have old-school
BASIC as an App Engine language.  Programmers have a familiarity with
Java, though, so that's why the interest in Java as an App Engine
language.

On Dec 31, 10:04 am, Aramaki  wrote:
> Hi, a few months ago I started with python to get used to GAE. Before
> that, I was working with java and it is still a language that I
> appreciate.
>
> But the fact is that after learning python I really don't see the
> advantage. My point is that python is strong enough to gracefully
> carry out almost any task conceived for GAE. It is fully OOP and
> strong enough. I use my eclipse like always so my question is guys:
>
> - The comunity interest in implementing java will give you so much
> advantage or it is because you do no want to learn python
--~--~-~--~~~---~--~~
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] When data is entered in the datastore, is it available at the same time to all instances?

2008-12-31 Thread bowman.jos...@gmail.com

Trying to track down a very inconsistent issue with gaeutilities
session. I don't know enough about the backend to make some guesses,
so am asking.

When I enter an entity into BigTable, is that the only instance that
exists and all front ends that users hit will read that same entity,
or is there some sort of data duplication/caching that could mean that
the entity is not available to an instance that the user is hitting?

Session works by sending a cookie with a session token, and then that
token is stored in the datastore. Every request the cookie is compared
against the datastore to determine if the user is logged in. There is
some memcache usage, but if the data is not found in memcache, the
datastore is checked.

I believe I've seen the same issue with a couple other processes I
have in place for oauth/open id logins, where I've gotten strange
random results of data not being found, but it's too inconsistent to
track down.

I can bang on the gaeutilities session without any problems. I in fact
set up some javascript request buttons on the session demo to try and
break it, haven't been able to replace the problem there.

The application where I do see the problem is a django 1.0
application, using appengine patch. Not sure why or how that would
matter but there you go.

I'm going to write some test scripts against that site to see if I can
get any luck duplicating the issue in a reliable sense in the next few
days.
--~--~-~--~~~---~--~~
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: When data is entered in the datastore, is it available at the same time to all instances?

2008-12-31 Thread djidjadji

Yes there is only one instance of the object in BigTable.

If a request calls put() on an object what happens is:

1) the object is created/updated in the Datastore
2) all the index tables are updated.
3) the put() returns

After the put call you know that a query for the object in the same
request handler will be retrieved correctly.

If another request handler does a query for the same kind it depends
when the query is executed in relation to the put() call.

before 1) you get the old version and the old index table
between 1 and 2) you get the new version and the old index table
(update), or not found (create)
after 2) you get the new version and the new index table

But if these requests come from a single user that does not do
simultanious requests this index-situation does not apply

2009/1/1 bowman.jos...@gmail.com :
>
> Trying to track down a very inconsistent issue with gaeutilities
> session. I don't know enough about the backend to make some guesses,
> so am asking.
>
> When I enter an entity into BigTable, is that the only instance that
> exists and all front ends that users hit will read that same entity,
> or is there some sort of data duplication/caching that could mean that
> the entity is not available to an instance that the user is hitting?
>
> Session works by sending a cookie with a session token, and then that
> token is stored in the datastore. Every request the cookie is compared
> against the datastore to determine if the user is logged in. There is
> some memcache usage, but if the data is not found in memcache, the
> datastore is checked.
>
> I believe I've seen the same issue with a couple other processes I
> have in place for oauth/open id logins, where I've gotten strange
> random results of data not being found, but it's too inconsistent to
> track down.
>
> I can bang on the gaeutilities session without any problems. I in fact
> set up some javascript request buttons on the session demo to try and
> break it, haven't been able to replace the problem there.
>
> The application where I do see the problem is a django 1.0
> application, using appengine patch. Not sure why or how that would
> matter but there you go.
>
> I'm going to write some test scripts against that site to see if I can
> get any luck duplicating the issue in a reliable sense in the next few
> days.
> >
>

--~--~-~--~~~---~--~~
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: Memcache Question

2008-12-31 Thread Toney

your correct about the quotes I did make a mistake when retyping the
code.

with the users.get_current_user() object what if I concatenated the
key as such...
query = memcache.get('Registration'+str(users.get_current_user()))

i'm not getting an error when I do it this way but i'm not sure if
doing it this way is a good idea

On Dec 31, 12:22 pm, djidjadji  wrote:
> There is NO difference, only the first names the individual arguments,
> you can call
> memcache.add(time=3600, value=query
> ,key="Registration'+users.get_current_user()" )
> and get the same result.
> The second versions uses the position of the arguments.
>
> I noticed some strange things with the quotes, single and double, are
> they exactly as given in the examples?
> users.get_current_user() returns a User object, this might not work
> very well in adding to a String unless Python calls the __str__()
> method on the User object because we try to add to a string.
>
> 2008/12/31 Toney :
>
>
>
> > I'm optimizing my code to use memcache, can anyone tell me the
> > difference between using memcache like this...
>
> > memcache.add(key="Registration'+users.get_current_user()",
> > value=query, time=3600)
>
> > versus this way...
>
> > memcache.add('Registration'+users.get_current_user(), query
>
> > I found one way while watching the building-scalable-web-applications-
> > with-google-app-engine video and the other in the memcache
> > documentation.
>
> > I'm thinking the second example appends data to the memcachce key and
> > the first replaces what's in the specific memcache key with the new
> > value.  or is there no difference??
--~--~-~--~~~---~--~~
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

2008-12-31 Thread luismgz

Anyway, I'm sure any half-competent java programmer would be able to
pick up python in a couple of hours.


On Dec 31 2008, 8:02 pm, warreninaustintexas
 wrote:
> Programmers are human beings - even though we work with logic-oriented
> problems.  We still have the natural human behavior of preferring
> something familiar over something unfamiliar - even if the unfamiliar
> environment is superior.  Java is familiar because it is the primary
> language taught in universities and it is one of the most commonly
> used languages in enterprise software.
>
> From a pure functionality standpoint, there is no reason to have Java
> on Google App Engine.  App Engine is scalable from a system
> architecture standpoint.  Google could just as easily have old-school
> BASIC as an App Engine language.  Programmers have a familiarity with
> Java, though, so that's why the interest in Java as an App Engine
> language.
>
> On Dec 31, 10:04 am, Aramaki  wrote:
>
> > Hi, a few months ago I started with python to get used to GAE. Before
> > that, I was working with java and it is still a language that I
> > appreciate.
>
> > But the fact is that after learning python I really don't see the
> > advantage. My point is that python is strong enough to gracefully
> > carry out almost any task conceived for GAE. It is fully OOP and
> > strong enough. I use my eclipse like always so my question is guys:
>
> > - The comunity interest in implementing java will give you so much
> > advantage or it is because you do no want to learn python
--~--~-~--~~~---~--~~
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

2008-12-31 Thread Bobby

Google does have GWT. If the AppEngine had support for Java we'd be
able to use Java alone to build GWT apps on the GAE. Java also has
plenty of good libraries, i in particular have a few i wouldn't mind
using on the server side. If support for another language is added i
hope it's Java.

Bobby

On Dec 31 2008, 10:26 pm, luismgz  wrote:
> Anyway, I'm sure any half-competent java programmer would be able to
> pick up python in a couple of hours.
>
> On Dec 31 2008, 8:02 pm, warreninaustintexas
>
>
>
>  wrote:
> > Programmers are human beings - even though we work with logic-oriented
> > problems.  We still have the natural human behavior of preferring
> > something familiar over something unfamiliar - even if the unfamiliar
> > environment is superior.  Java is familiar because it is the primary
> > language taught in universities and it is one of the most commonly
> > used languages in enterprise software.
>
> > From a pure functionality standpoint, there is no reason to have Java
> > on Google App Engine.  App Engine is scalable from a system
> > architecture standpoint.  Google could just as easily have old-school
> > BASIC as an App Engine language.  Programmers have a familiarity with
> > Java, though, so that's why the interest in Java as an App Engine
> > language.
>
> > On Dec 31, 10:04 am, Aramaki  wrote:
>
> > > Hi, a few months ago I started with python to get used to GAE. Before
> > > that, I was working with java and it is still a language that I
> > > appreciate.
>
> > > But the fact is that after learning python I really don't see the
> > > advantage. My point is that python is strong enough to gracefully
> > > carry out almost any task conceived for GAE. It is fully OOP and
> > > strong enough. I use my eclipse like always so my question is guys:
>
> > > - The comunity interest in implementing java will give you so much
> > > advantage or it is because you do no want to learn python- Hide quoted 
> > > text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---