Jun 25, 2010

Re: What is the best way to convert a dictionary of data into a datastore entity?

If you are going to use your dictionaries as dictionaries back in your
program then why not save those into a Blob or Text datastore property
(by pickling or repr - eval or other means).

Jun 17, 2010

SDK version 1.3.5 Prerelease

App Engine team announced V 1.3.5  prerelease, I do like the release early release often attitude.
From a quick source code reading, what I see as most important new feature in this release is the support for Content-range headers for Blobs and stream like interface to blobstore that will extend usage of blobstore to some new application scenarios.

Jun 16, 2010

Transparent App Engine logo

The other day I was looking for a transparent App Engine Logo to use in this blog.
Unfortunately I could not find one so I had to make it. Now it is available here .
As for people asking how I made this flying animation ( I know I know ...  it looks  stupid and obscuring etc. etc.  but I wanted this lovely plane to fly a bit !, it is all pure CSS  plus a couple of lines of js all made very easy with the new blogger template designer. Here are the steps :

Jun 13, 2010

DataStore Latency II

As promised Google went on an data store overhaul today.
One good thing is that there was no significant application disruption during the maintenance period, except of a short write-only read-only period that was pre announced by App Engine team.
Second good thing is that judging by my appls average response time the results are excellent.
This is also depicted in Datastore Status Page, which for historical reasons I am attaching here.
From the picture we can see that after around 03:30 PM when maintenance finished datastore latency dropped dramatically, also we do not see any spikes (well not until the time I write this - fingers crossed).
So lets keep the picture here and see how today's maintenance will affect App Engine on the long run.
Meanwhile I can see a change in Python's average response time which seems a little elevated but more steady than before.
Kudos to the App Engine team for the work they have done during the weekend  to minimize potential problems.

Jun 11, 2010

DataStore Latency

There is a lot of talk going on in technical blogosphere regarding App Engine's elevating datastore latency lately. Google has acknowledged the issue and respondend here and promised a fix within a couple of weeks.
The problem does affect the applications running in app engine as you can see from one of my Appls Site performance charts as plotted by Google Webmasters tools:
The explanation given by App Engine's team above is that this is the result of rapid growth rate of App Engines usage during past few months and I do believe this explanation.
The problem is that it also happened while Google announce App engine for Google Appls. My point of view is that App Engine should hold from expanding to new areas till all technical problems, outstanding issues and features promised in the road map get materialized. But then again who am I to tell Google what to do ?.
By the way an interesting but rather naive view has been written in App Engines mail-group about DataStore Latency affecting SEO.
One of the contributors there seems to believe  that  "But it could also happen nothing too because google detects that your site runs on their service" i.e. Google search could possibly will not penalize for been slow applications running on App Engine since these are running on Google's infrastructure.
Well I can tell you this can't happen since it defies search's main purpose to "provide best results for the user" besides I do not believe search results and serps can change that much within couple of weeks time (caffeine is just designed to target this delay).

Jun 5, 2010

MultipleChoiceField Django field with select multiple

Yesterday I was trying to find a way to use MultipleChoiceField Django field along with a CheckboxSelectMultiple Django widget for an input form that contains some tags used in an App Engine model field.
There is an excellent solution described in ( better-way-to-use-djangos-selectmultiple-in-google-app-engine-for-a-listproperty/) except that it relies on
google-app-engine-django package which is a nice package bridging App Engine db models and Django models.
But ... for this particular case I needed a light solution with a very small footprint and a minimum of imports.
It was more easy than I though.
First define our input choices and respective labels : tagChoises = ( ('Tag 1', 'Economy'), ('Tag 2','Geograpy'))
Then define your form item: tags = forms.MultipleChoiceField(required=False, choices=tagChoises , widget=forms.CheckboxSelectMultiple)
The form now displays the check boxes which a user can fill.
Problem is, if a user selects multi tags only the one is returned for saving into the db and since this value is a unicode string while a list of string values is expected it results in an form error.
Solution: intercept the retrurned value in Request Handler post this is a UnicodeMultiDict .
It turns out that getall method of this class returns a list of the selected strings so last item of code : self.request.POST['tags']=self.request.POST.getall('tags' ) makes the trick and posted values are ready to be put.
I know this is an ungly hack but still it is ok for situations where the complete Django package is an overkill.