[google-appengine] Django Syndication Troubles

2008-12-24 Thread Dylan Lorimer

Hi,

So I thought I'd take a stab at adding in the syndication framework
into my GAE Django app. However, I'm running into an error within the
feeds.py where it looks like it's trying to use class from the sites
contrib package.

Guess my question is whether anyone has had any success in getting
syndication to work with Django 1.0 on the GAE using the ZipImport
method for Django.

Cheers,
dylan

Stack Trace:
 -->  --> -->

Traceback (most recent call last):
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/
GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/
google/appengine/tools/dev_appserver.py", line 2443, in _HandleRequest
base_env_dict=env_dict)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/
GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/
google/appengine/tools/dev_appserver.py", line 353, in Dispatch
base_env_dict=base_env_dict)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/
GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/
google/appengine/tools/dev_appserver.py", line 1869, in Dispatch
self._module_dict)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/
GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/
google/appengine/tools/dev_appserver.py", line 1787, in ExecuteCGI
reset_modules = exec_script(handler_path, cgi_path, hook)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/
GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/
google/appengine/tools/dev_appserver.py", line 1685, in
ExecuteOrImportScript
script_module.main()
  File "/Users/edylan/Desktop/JaceyPhotographs2/main.py", line 48, in
main
util.run_wsgi_app(application)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/
GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/
google/appengine/ext/webapp/util.py", line 76, in run_wsgi_app
result = application(env, _start_response)
  File "/Users/edylan/Desktop/JaceyPhotographs2/django.zip/django/core/
handlers/wsgi.py", line 239, in __call__
  File "/Users/edylan/Desktop/JaceyPhotographs2/django.zip/django/core/
handlers/base.py", line 67, in get_response
try:
  File "/Users/edylan/Desktop/JaceyPhotographs2/django.zip/django/
middleware/common.py", line 57, in process_request
def process_response(self, request, response):
  File "/Users/edylan/Desktop/JaceyPhotographs2/django.zip/django/core/
urlresolvers.py", line 244, in resolve
  File "/Users/edylan/Desktop/JaceyPhotographs2/django.zip/django/core/
urlresolvers.py", line 180, in resolve
raise ImproperlyConfigured, "Error while importing URLconf %r: %s"
% (self.urlconf_name, e)
  File "/Users/edylan/Desktop/JaceyPhotographs2/django.zip/django/core/
urlresolvers.py", line 178, in resolve
except ValueError, e:
  File "/Users/edylan/Desktop/JaceyPhotographs2/django.zip/django/core/
urlresolvers.py", line 197, in _get_urlconf_module
return self._resolve_special('404')
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/
GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/
google/appengine/tools/dev_appserver.py", line 847, in decorate
return func(self, *args, **kwargs)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/
GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/
google/appengine/tools/dev_appserver.py", line 1443, in load_module
return self.FindAndLoadModule(submodule, fullname, search_path)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/
GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/
google/appengine/tools/dev_appserver.py", line 847, in decorate
return func(self, *args, **kwargs)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/
GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/
google/appengine/tools/dev_appserver.py", line 1351, in
FindAndLoadModule
description)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/
GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/
google/appengine/tools/dev_appserver.py", line 847, in decorate
return func(self, *args, **kwargs)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/
GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/
google/appengine/tools/dev_appserver.py", line 1301, in
LoadModuleRestricted
description)
  File "/Users/edylan/Desktop/JaceyPhotographs2/jaceyphotographs/
urls.py", line 16, in 
from feeds import latest_entries
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/
GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/
google/appengine/tools/dev_appserver.py", line 847, in decorate
return func(self, *args, **kwargs)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/
GoogleAppEngine-default.bundle/Contents/Resources/go

[google-appengine] Django template {# comments #} don't work for multiline comments

2008-12-24 Thread boson

{# one line is properly commented out, as it should be #}

{# but multiple lines are output as literal text,
as if they weren't even commented at all,
and we even see the comment begin/end tags! #}

Django Template Docs [1] don't mention this.  A little research [2][3]
revealed that the Django devs refuse to support multiline comments
unless you use the more cumbersome {% comment %} blah blah {%
endcomment %} syntax.

Hopefully this will save somebody else some time.  {# #} comments are
for single lines only, by design.

[1] http://www.djangoproject.com/documentation/0.96/templates/#comments
[2] http://code.djangoproject.com/ticket/3888
[3] 
http://groups.google.com/group/django-developers/browse_thread/thread/35ed32567776095


--~--~-~--~~~---~--~~
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: Hooks for custom serialization/deserialization? (e.g. JSON/deJSON)

2008-12-24 Thread boson

That's interesting.  I haven't looked into custom properties yet, but
it sounds like just what I was after.  By the same approach, I assume
one could easily make a JSONProperty as well...

I'm not very familiar with pickling.  Are there the advantage or
disadvantage to pickle vs. JSON?  Obviously JSON would be easier to
debug and inspect with the Data Viewer.  Does Pickle survive code
changes of the classes it represents?  I see the class name and other
data is present in the pickled form.  Also, are there major speed
differences (I heard that cPickle is not present in GAE -- does this
make for an extra slow pickle?).

Pickle overload: http://docs.python.org/library/pickle.html


On Dec 23, 11:14 pm, Alexander Kojevnikov 
wrote:
> http://is.gd/dgBK
>
> On Dec 24, 5:38 pm, boson  wrote:
>
> > Is there a good way (any way) to hook a db.Model subclass so that it
> > does some magic right before being written to the Datastore, and some
> > reverse magic right when it's read back?
>
> > E.g. Say you want to have a big JSON object stored in a TextProperty.
> > Obviously you could JSON and de-JSON it yourself every time you load
> > or save it.  But ideally you could hook this code into the class
> > itself, so as soon as it's read from the store the JSON string is gone
> > and a Python object is in its place.  Similarly, you could manipulate
> > the Python object and write it back to the store, where it would be
> > quickly re-JSONed prior to hitting BigTable.
>
> > Or maybe there's another better way to work with and serialize
> > arbitrary Python data (lists, dicts, etc.) without writing the code
> > for it in multiple places... Pickle?
--~--~-~--~~~---~--~~
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: Hooks for custom serialization/deserialization? (e.g. JSON/deJSON)

2008-12-24 Thread boson

JSONProperty:

http://appengine-cookbook.appspot.com/recipe/add-a-jsonproperty-to-your-model-to-save-a-dict-to-the-datastore/

Curious about performance implications.  Is anybody actually doing
this?


On Dec 24, 1:28 am, boson  wrote:
> That's interesting.  I haven't looked into custom properties yet, but
> it sounds like just what I was after.  By the same approach, I assume
> one could easily make a JSONProperty as well...
>
> I'm not very familiar with pickling.  Are there the advantage or
> disadvantage to pickle vs. JSON?  Obviously JSON would be easier to
> debug and inspect with the Data Viewer.  Does Pickle survive code
> changes of the classes it represents?  I see the class name and other
> data is present in the pickled form.  Also, are there major speed
> differences (I heard that cPickle is not present in GAE -- does this
> make for an extra slow pickle?).
>
> Pickle overload:http://docs.python.org/library/pickle.html
>
> On Dec 23, 11:14 pm, Alexander Kojevnikov 
> wrote:
>
> >http://is.gd/dgBK
>
> > On Dec 24, 5:38 pm, boson  wrote:
>
> > > Is there a good way (any way) to hook a db.Model subclass so that it
> > > does some magic right before being written to the Datastore, and some
> > > reverse magic right when it's read back?
>
> > > E.g. Say you want to have a big JSON object stored in a TextProperty.
> > > Obviously you could JSON and de-JSON it yourself every time you load
> > > or save it.  But ideally you could hook this code into the class
> > > itself, so as soon as it's read from the store the JSON string is gone
> > > and a Python object is in its place.  Similarly, you could manipulate
> > > the Python object and write it back to the store, where it would be
> > > quickly re-JSONed prior to hitting BigTable.
>
> > > Or maybe there's another better way to work with and serialize
> > > arbitrary Python data (lists, dicts, etc.) without writing the code
> > > for it in multiple places... Pickle?
--~--~-~--~~~---~--~~
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

2008-12-24 Thread rvjcallanan


> Can you suggest some applications where global clock skew on the order
> of a few seconds is a big problem? There are probably other ways of
> coping without sacrificing the scalability guarantees that Google's
> infrastructure provides.
>

My invoicing example is a perfect case in point. Imagine if you got a
burst of purchases across the globe around the same time in response
to a mailshot or TV ad. Another example is a remote data logging app I
am mulling over whereby 100s of cellphone are simultaneously sending
aquired data via HTTP to the mother GAE app.

Scalability is not necessarily an excuse for the clock skew that GAE
users are currently experiencing. I guess skew was never a serious
issue for Google services before GAE came on stream.

> Keep in mind that it takes a photon of light about 130 ms to go around
> the world, so your users would probably be at least that far away from
> the servers. Even with the servers being completely synchronised
> within nanoseconds, you will have a significant latency between the
> servers and your users.

I think you underestimate the accuracy of NTP which uses a very clever
algorithm, being able to cope with the issues you describe. My
understanding is that 1mS drift is achievable on a LAN and 10mS on a
WAN, so my 100mS suggestion is not stretching things that much. It
would be nice to have a guaranteed clock skew limit under 500mS as
many applications round time down to one second chunks. I don't want
to get hung up on an absolute figure here but there is little value in
telling us that clock skew will usually be of the order of a few
seconds *but* there are no guarantees.

And yes, you are absolutely correct regarding latency issues so no
matter how low we can bring clock skew, the problem of preserving time/
date sequence (as distinct from accuracy) will not go away. Hence my
suggestion for an app-specific centralised reference clock geared
around the requirements I describe. Yes, I am aware that this would
require a dedicated process and would need to be fault tolerant but we
know Google is thinking of allowing background tasks when billing is
introduced. Such a feature could be (optionally) used by the datastore
auto date/time function (at the expense of slightly slower updates) if
this was an issue for a particular application.

Don't get me wrong here! I'm completely smitten by GAE. I am merely
hoping that the GAE team gives this issue (along with 100s of others)
some serious thought in the near future.

One common theme that seems to be emerging is that scalability is not
always a sufficient excuse for *not* implementing a feature. If there
is a performance and cost hit for accessing a particular function then
so be it...that is the app developers decision but he should at least
be sufficiently informed to use such a feature sparingly and only if
all other avenues have been explored.

Rgds,
rvjcallanan
--~--~-~--~~~---~--~~
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

2008-12-24 Thread Andy Freeman

> My invoicing example is a perfect case in point. Imagine if you got a
> burst of purchases across the globe around the same time in response
> to a mailshot or TV ad. Another example is a remote data logging app I
> am mulling over whereby 100s of cellphone are simultaneously sending
> aquired data via HTTP to the mother GAE app.

How could these users know that the application used inconsistent
timestamps?  Even if they knew of each other's existence, which they
don't, they don't have synchronized clocks.

The case where it's easiest for a user to detect the consequences of
clock skew is a burst of requests from single user.  However, as long
as your client doesn't send simultaneous requests, all requests by a
given user within a short time frame are likely to be served in order
by the same process and that process is self-consistent.

On Dec 24, 2:36 am, rvjcallanan  wrote:
> > Can you suggest some applications where global clock skew on the order
> > of a few seconds is a big problem? There are probably other ways of
> > coping without sacrificing the scalability guarantees that Google's
> > infrastructure provides.
>
> My invoicing example is a perfect case in point. Imagine if you got a
> burst of purchases across the globe around the same time in response
> to a mailshot or TV ad. Another example is a remote data logging app I
> am mulling over whereby 100s of cellphone are simultaneously sending
> aquired data via HTTP to the mother GAE app.
>
> Scalability is not necessarily an excuse for the clock skew that GAE
> users are currently experiencing. I guess skew was never a serious
> issue for Google services before GAE came on stream.
>
> > Keep in mind that it takes a photon of light about 130 ms to go around
> > the world, so your users would probably be at least that far away from
> > the servers. Even with the servers being completely synchronised
> > within nanoseconds, you will have a significant latency between the
> > servers and your users.
>
> I think you underestimate the accuracy of NTP which uses a very clever
> algorithm, being able to cope with the issues you describe. My
> understanding is that 1mS drift is achievable on a LAN and 10mS on a
> WAN, so my 100mS suggestion is not stretching things that much. It
> would be nice to have a guaranteed clock skew limit under 500mS as
> many applications round time down to one second chunks. I don't want
> to get hung up on an absolute figure here but there is little value in
> telling us that clock skew will usually be of the order of a few
> seconds *but* there are no guarantees.
>
> And yes, you are absolutely correct regarding latency issues so no
> matter how low we can bring clock skew, the problem of preserving time/
> date sequence (as distinct from accuracy) will not go away. Hence my
> suggestion for an app-specific centralised reference clock geared
> around the requirements I describe. Yes, I am aware that this would
> require a dedicated process and would need to be fault tolerant but we
> know Google is thinking of allowing background tasks when billing is
> introduced. Such a feature could be (optionally) used by the datastore
> auto date/time function (at the expense of slightly slower updates) if
> this was an issue for a particular application.
>
> Don't get me wrong here! I'm completely smitten by GAE. I am merely
> hoping that the GAE team gives this issue (along with 100s of others)
> some serious thought in the near future.
>
> One common theme that seems to be emerging is that scalability is not
> always a sufficient excuse for *not* implementing a feature. If there
> is a performance and cost hit for accessing a particular function then
> so be it...that is the app developers decision but he should at least
> be sufficiently informed to use such a feature sparingly and only if
> all other avenues have been explored.
>
> Rgds,
> rvjcallanan
--~--~-~--~~~---~--~~
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: Full Text Search Library for google app engine via Goolge Base

2008-12-24 Thread Michael

Sound very interesting.

How do you use Google base ? Use Google API ?

I need full text search for a shopping site, so all products.

On Dec 23, 7:31 am, gops  wrote:
> I am desperately in need of full text search for google app engine.
> The current solution { searchable models are horrible. }.  It seems to
> me that, using google base for search is only solution for full text
> search. ( I hope i am wrong!!).  So my idea is to create a
> GoogleBaseModel which automatically use datastore for storing and
> google base for searching.
>
> Now , my question is , is it allowed ? in legal terms ? to use google
> base to store DATA -- which might not be product or book or things. ??
>
> 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: Money sum formating

2008-12-24 Thread Joel Odom
Here's a little function I wrote that you may have:

def formatAsDollars(amount):
  dollars = int(amount)
  cents = amount - dollars

  i = 0
  reverseDollarPlaces = []
  for p in str(dollars)[::-1]:
if i % 3 == 0 and i:
  reverseDollarPlaces.append(',')
reverseDollarPlaces.append(p)
i += 1

  return '$%s.%.2i' % (''.join(reverseDollarPlaces[::-1]), int(100*cents))




On Tue, Dec 23, 2008 at 2:32 PM, Shay Ben Dov  wrote:

>
> Hi,
>
> I know that if
>
> sum = 56.0
>
> then
>
> {{ sum|floatformat:2 }} will display 56.00
>
> How we get $560,000.00
>
> Thanks,
>
> Shay Ben Dov
>
>
>
> >
>


-- 
http://giscoder.blogspot.com/

--~--~-~--~~~---~--~~
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: Mysterious change to ModelForms module?

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

I noticed the Kind cache the other day, not sure if it's new or not,
but they've added a note underneath the select button telling you old
the information is. However, in my case, the Kinds are never getting
updated, even if I check days later.

On Dec 23, 3:17 pm, djidjadji  wrote:
> The Kind dropdown has a cach with a certain refresh time.
> I also had a problem like this until Marzia told about the Dataviewer cash.
> Does the problem also show when you wait a few minutes and do a reload
> of the Dataviewer?
>
> 2008/12/22 bowman.jos...@gmail.com :
>
>
>
> > Also, had to check this morning to be sure. The get_or_insert Kind is
> > not available via the Kind drop down in the data view, though it can
> > be found using gql
--~--~-~--~~~---~--~~
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: Money sum formating

2008-12-24 Thread djidjadji

The next function is a bit faster

import re
def formatAsDollars(amount):
  part = ("%.2f"%amount).split(".")
  part[0] = re.sub(r'\B(?=(...)*$)',',',part[0])
  return '$'+'.'.join(part)


2008/12/24 Joel Odom :
> Here's a little function I wrote that you may have:
>
> def formatAsDollars(amount):
>   dollars = int(amount)
>   cents = amount - dollars
>
>   i = 0
>   reverseDollarPlaces = []
>   for p in str(dollars)[::-1]:
> if i % 3 == 0 and i:
>   reverseDollarPlaces.append(',')
> reverseDollarPlaces.append(p)
> i += 1
>
>   return '$%s.%.2i' % (''.join(reverseDollarPlaces[::-1]), int(100*cents))

> On Tue, Dec 23, 2008 at 2:32 PM, Shay Ben Dov  wrote:
>>
>> Hi,
>>
>> I know that if
>>
>> sum = 56.0
>>
>> then
>>
>> {{ sum|floatformat:2 }} will display 56.00
>>
>> How we get $560,000.00
>>
>> Thanks,
>>
>> Shay Ben Dov
> --
> http://giscoder.blogspot.com/

--~--~-~--~~~---~--~~
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: 1 application, multiple datastores

2008-12-24 Thread hawkett

> You're hoping that the partitioning for a given datastore depends on
> how google allows access to said datastore

Exactly - that is the feature  request I am proposing.  It seems
likely to me that GAE uses a data partitioning feature of BigTable
(maybe not, I don't know, but to me it seems the right place to
implement a data partitioning function) - they should expand the way
GAE uses that BigTable feature to offer the functionality I am
requesting.

> If your customers are serious, they must, regardless of how your
> application is deployed, regardless of who handles login/access
> management.  Login code isn't the only risk.

Perhaps, but the threshold is significantly lowered - customers are
more likely to undertake an audit (rather than go to a competitor) if
they can see you are using platform features for security - I stand by
the assertion that 100% of customers who engage you for the first time
will prefer you to be using the platform over custom application code
- especially for security.

> And, if you're serious about login code, you must validate the login
> result.  That is, once it is determined that a given user running your
> application should use a given datastore, the application then must
> look the datastore that it is trying to use and verify that it is
> actually the correct datastore for that user

I don't agree.  You should trust your authentication mechanism - this
is a trust relationship.  If you don't trust it, then you need to
address that problem, not write additional application code which adds
to the complexity of your security implementation.  Complexity in your
security implementation increases risk, not decreases it.  Note this
is not an argument against defense in depth - it is an argument for
simplicity in each implementation layer.  We are talking about the
authentication layer, and the db access layer, and both should be
platform concerns, not application concerns (at least from my
perspective) - certainly they are currently platform concerns in GAE,
and I would like them to stay that way.

It is very important to note that the functionality is *nearly* there
already - i.e. restricting access to users from a google apps account
- it has strict data partitioning, authentication and db access are
platform concerns, user provisioning administration etc. is already
there in google apps.  The only thing missing is a method of
automatically spawning a new application in response to a customer
registration (and the 10 app limit).

The architecture of GAE right now is totally in line with what I am
talking about, and I have no doubt that this is for all the reasons I
have listed, and many I haven't even thought of.  Consequently I doubt
that you will ever be given the functionality you are looking for -
i.e. accessing multiple datastores from the same application instance.

I'll ask again - would a feature that allowed you to map the same
datastore to multiple application instances satisfy your use-case?  It
does stretch the data partitioning thing a bit, but might be workable
from a platform configuration perspective.


On Dec 23, 7:22 pm, Andy Freeman  wrote:
> > In fact, given that Google already
> > have a data partitioning mechanism for applications, I wouldn't be
> > surprised if it was even lower level than the GAE platform, and part
> > of the BigTable implementation.
>
> You're hoping that the partitioning for a given datastore depends on
> how google allows access to said datastore.  In particular, you're
> hoping that the partitioning for datastores using a feature where a
> given application can pick between a set of datastores is different
> than the partitioning when a given application has access to exactly
> one datastore.
>
> That's unlikely.  If google decides to implement such a feature, it
> would be silly to also introduce a different mechanism for
> partitioning datastores.
>
> > How would they even begin to assess the risk profile - do
> > they have to audit your company's development practices?
>
> If your customers are serious, they must, regardless of how your
> application is deployed, regardless of who handles login/access
> management.  Login code isn't the only risk.
>
> And, if you're serious about login code, you must validate the login
> result.  That is, once it is determined that a given user running your
> application should use a given datastore, the application then must
> look the datastore that it is trying to use and verify that it is
> actually the correct datastore for that user.  Platform login code
> can't do that check.  And, the platform's login doesn't provide much
> information to the application for it to do such a check.
>
> Yes, I realize that customers have different risk and cost
> sensitivities so there must be some right around the points that you
> like.  However, that's a long way from saying that such points
> dominate.
>
> On Dec 22, 2:03 pm, hawkett  wrote:
>
> > > No, I don't agree.  Even if we ignore the admin

[google-appengine] Re: OT: adding google gadgets to web pages

2008-12-24 Thread Barry Hunter

yes.

Why would you think it wouldnt be?

2008/12/24 v4vijayakumar :
>
> Is it possible to add google gadgets to web pages deployed in
> appengine ?
> >
>



-- 
Barry

- www.nearby.org.uk - www.geograph.org.uk -

--~--~-~--~~~---~--~~
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: Full Text Search Library for google app engine via Goolge Base

2008-12-24 Thread dalenewman

If anyone tries this google base thing for search, let me me know how
it works out.

There is a python client for all the gdata web services here:

http://code.google.com/p/gdata-python-client/

I don't know if it works in GAE's restricted environment though.

Dale
--~--~-~--~~~---~--~~
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: Full Text Search Library for google app engine via Goolge Base

2008-12-24 Thread Ross M Karchner
it sure does, instructions for using it are here:

http://code.google.com/appengine/docs/usinggdataservices.html

On Wed, Dec 24, 2008 at 2:00 PM, dalenewman  wrote:

>
> If anyone tries this google base thing for search, let me me know how
> it works out.
>
> There is a python client for all the gdata web services here:
>
> http://code.google.com/p/gdata-python-client/
>
> I don't know if it works in GAE's restricted environment though.
>
> Dale
> >
>

--~--~-~--~~~---~--~~
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: Money sum formating

2008-12-24 Thread Alexander Kojevnikov

You can also use the standard locale module:

>>> import locale
>>> locale.setlocale(locale.LC_ALL, '')
>>> locale.format('%.2f', 1234.5678, True)
'1,234.57'

http://www.python.org/doc/2.5.2/lib/module-locale.html
--~--~-~--~~~---~--~~
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: 1 application, multiple datastores

2008-12-24 Thread Andy Freeman

>> You're hoping that the partitioning for a given datastore depends on
>> how google allows access to said datastore

> Exactly - that is the feature  request I am proposing.

Huh?  You were requesting the ability to spawn a new datastore and to
have the login scheme for a given pile of application code pick the
datastore.  The above is about methods for separating datastores and
whether the method for separating them should depend on how the
datastore is chosen.

> I don't agree.  You should trust your authentication mechanism - this
> is a trust relationship.  If you don't trust it, then you need to
> address that problem, not write additional application code which adds
> to the complexity of your security implementation.  Complexity in your
> security implementation increases risk, not decreases it.  Note this
> is not an argument against defense in depth - it is an argument for
> simplicity in each implementation layer.

Let's look at these alternatives.

With no post-login check, the application runs using whatever
datastore the login procedure finds acceptable.  If the login
procedure fails or the datastore layer serves up the wrong datastore,
the application still does its thing.

Post-validate may catch either of those errors.  (Of course, the post-
validate could fail as well and allow access when it shouldn't, but
that just leaves you no worse off than you were without the check.)
Yes, the post-validate may block execution when it shouldn't, but
that's likely to be because the datastore layer is misbehaving,
delivering wrong data.  The application may have failed eventually
anyway when running with a misbehaving datastore layer, but detection
during validation is better because the application doesn't get a
chance to corrupt user-data.


On Dec 24, 10:17 am, hawkett  wrote:
> > You're hoping that the partitioning for a given datastore depends on
> > how google allows access to said datastore
>
> Exactly - that is the feature  request I am proposing.  It seems
> likely to me that GAE uses a data partitioning feature of BigTable
> (maybe not, I don't know, but to me it seems the right place to
> implement a data partitioning function) - they should expand the way
> GAE uses that BigTable feature to offer the functionality I am
> requesting.
>
> > If your customers are serious, they must, regardless of how your
> > application is deployed, regardless of who handles login/access
> > management.  Login code isn't the only risk.
>
> Perhaps, but the threshold is significantly lowered - customers are
> more likely to undertake an audit (rather than go to a competitor) if
> they can see you are using platform features for security - I stand by
> the assertion that 100% of customers who engage you for the first time
> will prefer you to be using the platform over custom application code
> - especially for security.
>
> > And, if you're serious about login code, you must validate the login
> > result.  That is, once it is determined that a given user running your
> > application should use a given datastore, the application then must
> > look the datastore that it is trying to use and verify that it is
> > actually the correct datastore for that user
>
> I don't agree.  You should trust your authentication mechanism - this
> is a trust relationship.  If you don't trust it, then you need to
> address that problem, not write additional application code which adds
> to the complexity of your security implementation.  Complexity in your
> security implementation increases risk, not decreases it.  Note this
> is not an argument against defense in depth - it is an argument for
> simplicity in each implementation layer.  We are talking about the
> authentication layer, and the db access layer, and both should be
> platform concerns, not application concerns (at least from my
> perspective) - certainly they are currently platform concerns in GAE,
> and I would like them to stay that way.
>
> It is very important to note that the functionality is *nearly* there
> already - i.e. restricting access to users from a google apps account
> - it has strict data partitioning, authentication and db access are
> platform concerns, user provisioning administration etc. is already
> there in google apps.  The only thing missing is a method of
> automatically spawning a new application in response to a customer
> registration (and the 10 app limit).
>
> The architecture of GAE right now is totally in line with what I am
> talking about, and I have no doubt that this is for all the reasons I
> have listed, and many I haven't even thought of.  Consequently I doubt
> that you will ever be given the functionality you are looking for -
> i.e. accessing multiple datastores from the same application instance.
>
> I'll ask again - would a feature that allowed you to map the same
> datastore to multiple application instances satisfy your use-case?  It
> does stretch the data partitioning thing a bit, but might be workable
> from a pl

[google-appengine] Got 'The site you have requested could not be found. (404)'

2008-12-24 Thread Min Li

Hi,

I got the 'The site you have requested could not be found. (404)' when
I access the domain name which has been linked with my gae app. I
tried to disable the domain map in google app control panel, but it
did nothing.

Please help to have a look.

Min


--~--~-~--~~~---~--~~
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] Discussion on deleting-existing-www-mapping-from-google-apps

2008-12-24 Thread Min Li

Right now I got the 'the site you have requested could not be found.
(404)' when accessing my www mapping for my google app engine app.  So
I follow the instruction to delete the www mapping but I got the
message 'This address is already being used.' when I try to add 'www'
mapping.

Thanks,
Min
--~--~-~--~~~---~--~~
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] My Christmas present: Introducing Gaebar

2008-12-24 Thread Aral

Hey everyone,

I just released Gaebar (Google App Engine Backup and Restore). Enjoy!

For a screencast, full description, etc., please see http://aralbalkan.com/1784

Happy Holidays! :)

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: Date range overlapping query in Datastore

2008-12-24 Thread Garrett Davis

You can handle your query if you add another field in your Kind, a
ListProperty containing both the start date and end date.

Try this:

class FicaTable(db.Model):
""" a table of salary amounts subject to Social Security tax, by
tax year """
eff_date   = db.DateTimeProperty()
exp_date   = db.DateTimeProperty()
date_range = db.ListProperty(datetime.datetime)
max_tax_base = db.IntegerProperty()

OASDI_RATES = """\
2001 80400
2002 84900
2003 87000
2004 87000
2005 9
2006 94200
2007 97500
2008 102000
2009 106800
"""

def flush_tax_tables():
""" flush any leftover data from previous runs
"""
query_all_records = FicaTable.all()
rec_count = query_all_records.count()
if rec_count:
print 'Deleting %d records from datastore' % (rec_count)
for rec in query_all_records:
rec.delete()

def parse_date(_mm_dd):
return datetime.datetime(*time.strptime(_mm_dd, "%Y-%m-%d")
[0:3])

def load_tax_tables():
for table_data in OASDI_RATES.splitlines():
(year, max_tax_base) = table_data.split()
eff_date = parse_date(year + '-01-01')
exp_date = parse_date(year + '-12-31')
table_vals = {'eff_date' : eff_date,
  'exp_date' : exp_date,
  'date_range': [eff_date, exp_date],
  'max_tax_base': int(max_tax_base)
  }
table_rec = FicaTable(**table_vals)
table_rec.save()

query_all_records = FicaTable.all()
rec_count = query_all_records.count()
print 'Loaded %d tax table records' % (rec_count)

from google.appengine.api.datastore_errors import BadFilterError

def query_tax_tables():
""" this fails with the message: "invalid filter:
Only one property per query may have inequality filters ..."
"""
query_template = "WHERE eff_date >= :1 AND exp_date <= :1"

q = FicaTable.gql(query_template, datetime.date(2005,05,15))
print
print "Trying 'traditional' query with two date fields"
try:
rec = q.fetch(1)
except BadFilterError:
print "I told you this wouldn't work"

""" but this works:
"""
print
print "Trying query against date_range"

query_template = "WHERE date_range >= :1 AND date_range <= :1"

query_date = datetime.date(2005,05,15)
q = FicaTable.gql(query_template, query_date)

table_rec = q.get()
date_str = query_date.isoformat()
# datetime.time.strftime("%Y-%m-%d", query_date)
print 'The maximum amount subject to FICA OASD for %s is %d' % \
  (date_str, table_rec.max_tax_base)

if __name__ == "__main__":
flush_tax_tables()
load_tax_tables()
query_tax_tables()


Let me know if anyone has any problems understanding or running the
example.
After I'm sure it's accurate and well-enough documented, I should post
it to the App Engine 'cookbook':
http://appengine-cookbook.appspot.com/

Garrett Davis


On Dec 23, 2:23 pm, maverick  wrote:
> Due to the limitation of GAE's datastore "Inequality Filters Are
> Allowed On One Property Only", a simple date range overlapping query
> become a problem.
>
> I have a Kind which contains 2 properties: date_begin, date_end, I
> need to run a query to find out all rows which overlapping the date
> range given (datebegin2, dateend2).  in a SQL query it just simple
> "@StartDate1 <= @EndDate2 AND @StartDate1 <= @EndDate1 " in WHERE
> clause, however in GQL, we have a problem.
>
> Does anyone have a solution  for this?  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 much time to give for each db query in order not to occur DeadlineExceededError

2008-12-24 Thread Bob

I see, it seems to be the best solution right now:) thanks

On Dec 23, 2:28 am, Marzia Niccolai  wrote:
> Hi,
>
> It's difficult to estimate the amount of time it takes to put() and delete()
> datastore entities because it depends a great deal on the size and shape of
> your entities.
>
> One thing you should do is call db.Put(entities) in one call, instead of
> multiple calls in one request to entity.put().  Also, you can't rely on the
> speed of the dev_appserver to be indicative of the speed on App Engine
> itself.
>
> The best advice I can give is, if you see the datastore is constantly timing
> out on a given request, reduce the number of entity updates in that request
> until you find the number that best fits your data.
>
> -Marzia
>
> On Sat, Dec 20, 2008 at 6:19 PM, Bob  wrote:
>
> > Hi GAE team,
>
> > how about the time for deleting? I think it would also encounter the
> > DeadlineExceededError..
>
> > Thank you:>
>
> > On Dec 20, 11:52 pm, Bob  wrote:
> > > Too much db operations, it needs 10 seconds on my own computers to
> > > read the whole file to store in the datastore. But on the GAE, it
> > > occurs DeadlineExceededError. I gave  0.2 second for each db put(), it
> > > could work first but finally went wrong. I then gave 0.5 second and
> > > still could't solve the problem.
>
> > > How much time shall I give??
--~--~-~--~~~---~--~~
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: Money sum formating

2008-12-24 Thread Shay Ben Dov

Thanks for the answer.

Merry Christmas & Happy New Year

Shay

On Dec 25, 12:49 am, Alexander Kojevnikov 
wrote:
> You can also use the standard locale module:
>
> >>> import locale
> >>> locale.setlocale(locale.LC_ALL, '')
> >>> locale.format('%.2f', 1234.5678, True)
>
> '1,234.57'
>
> http://www.python.org/doc/2.5.2/lib/module-locale.html
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---