[google-appengine] Re: Entities question

2009-01-16 Thread Chen Harel

Bill if I use an ownership model,
How do you fetch all the cds of a user?
you select on Ownership, then get the tuples with user id / cd id
Now you need to fetch many cd id from the CD entity..
So what's the difference?
If you store them as a list of IDs in the User, you still have to go
over the CD and fetch for every ID,
This still doesn't allow you to properly index your data, does it?

On Jan 16, 8:14 pm, Bill  wrote:
> > I'm not sure I've followed you with whole Ownership model..
> > Isn't that a RDBMS approach to the data and not BigTable's?
>
> The two approaches aren't mutually exclusive.  In the case of User <->
> CD, a User can have thousands or more CDs and a CD could be purchased
> by millions.  Under those circumstances, storing the ownership
> relationship in a list of references under either User or CD entities
> will really impact performance.
>
> In Rafe Kaplan's article he says:
> "Another more important one is that you want to avoid storing overly
> large lists of keys in a ListProperty."
>
> The straightforward alternative is a separate Ownership model and now
> there's a separate issue of constructing a transaction that handles
> updating your genre counter upon a successful Ownership change.
>
> It'll be interesting if someone comes up with another approach, maybe
> using multiple User entities (under one entity group) that all map to
> a single user, with each User entity holding a subset of all the CDs
> and genre counters.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] How to do it without using javascript?

2009-01-16 Thread arnie

Using a wsgi application and without using javascript is it possible
to calculate the latitude and longitude of a physical address using
Google Maps API? If yes then how? I have searched a lot but finds only
javascript references. My requirement is to fetch Latitude/Longitude
values when the physical address information is being saved in
datastore using a wsgi application
Any idea?
Thanks
Arnie
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] what's this quota?

2009-01-16 Thread lookon

Your application is exceeding a quota: App Config Service Config App
Call Count

how will I get this message?
--~--~-~--~~~---~--~~
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 does this CPU limit stuff really work?

2009-01-16 Thread Josh Heitzman

http://code.google.com/p/googleappengine/issues/detail?id=240 is an
issue related to the issue you raised in your post.

On Jan 16, 1:31 pm, boson  wrote:
> After a URL in the request log are the following fields (example):
> 200 1584ms 2571ms-cpu 4kb
> Am I correct in believing these are: HTTP response code, real time,
> "CPU time", and response size?
>
> Now I get various orange and red warnings depending on the ms-cpu
> value (almost always when I create an entity, and often just for
> writing one - even simple ones).  But I haven't ever seen any increase
> in my "High CPU Requests" on the quota page.  Is this normal?
>
> I've read these pages, but I'm still not sure what's going on 
> here.http://code.google.com/appengine/docs/quotas.html#Resourceshttp://code.google.com/appengine/articles/quotas.html
>
> The first page says "Datastore CPU time does not count towards the
> high CPU threshold", but apparently it IS included in the value in the
> request log where the warning comes from.  Is there a breakdown
> anywhere of whether this time is in user CPU or DS CPU?
>
> Also with the amount of CPU time reported in the request log, it seems
> that even modest traffic will kill the CPU Time quota, as even the
> most basic DS write operations with a handful of properties seem to
> often take ~1000ms-cpu (even when the request itself takes less time).
>
> I'm not even sure what questions to ask here, so if you can answer the
> obvious unasked ones too please do so.  I'm rather confused by all
> this, but am hoping it's more obvious than it seems right now...
>
> 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: Version 1.1.8 - January 7, 2008

2009-01-16 Thread Roberto Saccon

Great  !

I observed that this needs the ANTLR parser (for some stuff related to
cron ! Hopefully very soon now ...)

Anyway, if you don't have it grab it at:
http://www.antlr.org/wiki/display/ANTLR3/Python+runtime

Roberto

On Jan 16, 11:01 pm, lookon  wrote:
> it's cool for
>
> Get height and width of an image via the Images API.
--~--~-~--~~~---~--~~
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] Version 1.1.8 - January 7, 2008

2009-01-16 Thread lookon

it's cool for

Get height and width of an image via the Images API.
--~--~-~--~~~---~--~~
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: Canwe share?

2009-01-16 Thread Dan Sanderson
On Thu, Jan 15, 2009 at 2:06 AM, arnie  wrote:

>
> Can we share same datastore tables [2 tables with 1-to many
> relationships] between more than one wsgi applications on GAE?


If your question is about sharing a datastore between 2 App Engine
applications, such as app1.appspot.com and app2.appspot.com, then the answer
is no.  Each App Engine application gets its own datastore that is
completely separate from other applications.

If your question is about 2 WSGI application classes defined in the code of
a single App Engine application, the answer is yes.  All code running in a
single App Engine application accesses the same datastore.

-- Dan

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Can we do it in GAE

2009-01-16 Thread iceanfire

http://groups.google.com/group/google-appengine/browse_thread/thread/b5f599a1e43c0a26/d4434084f0344550?lnk=gst&q=geocoding#d4434084f0344550

On Jan 14, 1:44 am, Jonk  wrote:
> On 14 tammi, 09:32, arnie  wrote:
>
> > Is it possible to convert a physical location [such as address of a
> > company] into co-ordinates [Latitude and Longitude]. I have seen this
>
> http://code.google.com/apis/maps/documentation/services.html#Geocoding
>
>     j
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: What is Data Storage Limit in GAE DataStore

2009-01-16 Thread iceanfire

According to the roadmap: http://code.google.com/appengine/docs/roadmap.html

Google is coming out with : "Service for storing and serving large
files" that might be useful to you depending on the size of the
pictures you're uploading.

Also, they will at some point start the billing system, which will
allow you to buy additional quota at a cost.

On Jan 15, 2:32 pm, anand  wrote:
> Thanks all for such a quick reply!
>
> On Jan 15, 12:42 pm, "Qian Qiao"  wrote:
>
> > On Fri, Jan 16, 2009 at 03:34, anand  wrote:
>
> > > How much data can I store in GAE datastore per application? I have a
> > > requirement to store a large volume of data (a lot of pics) in
> > > datastore. Is there any limit?
>
> > > Thanks for your help.
>
> > > Regards,
> > > Anand
>
> > The storage quota is 500MB, you can do 2,500,000 datastore API calls per 
> > day.[1]
>
> > They do allow you to apply for extra quota.[2]
>
> > HTH.
>
> > -- Joe
>
> > 1.http://code.google.com/appengine/articles/quotas.html
> > 2.http://code.google.com/support/bin/request.py?contact_type=AppEngineC...
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] How does this CPU limit stuff really work?

2009-01-16 Thread boson

After a URL in the request log are the following fields (example):
200 1584ms 2571ms-cpu 4kb
Am I correct in believing these are: HTTP response code, real time,
"CPU time", and response size?

Now I get various orange and red warnings depending on the ms-cpu
value (almost always when I create an entity, and often just for
writing one - even simple ones).  But I haven't ever seen any increase
in my "High CPU Requests" on the quota page.  Is this normal?

I've read these pages, but I'm still not sure what's going on here.
http://code.google.com/appengine/docs/quotas.html#Resources
http://code.google.com/appengine/articles/quotas.html

The first page says "Datastore CPU time does not count towards the
high CPU threshold", but apparently it IS included in the value in the
request log where the warning comes from.  Is there a breakdown
anywhere of whether this time is in user CPU or DS CPU?

Also with the amount of CPU time reported in the request log, it seems
that even modest traffic will kill the CPU Time quota, as even the
most basic DS write operations with a handful of properties seem to
often take ~1000ms-cpu (even when the request itself takes less time).

I'm not even sure what questions to ask here, so if you can answer the
obvious unasked ones too please do so.  I'm rather confused by all
this, but am hoping it's more obvious than it seems right now...

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: Looking for help to finish a new model to catch datastore timeouts

2009-01-16 Thread boson

On Jan 16, 11:25 am, Devel63  wrote:
> I wish I knew how to solve this, but I don't.  I hope someone can tell
> both of us what the preferred method for handling a put override is.

That was the subject of this still open thread:
http://groups.google.com/group/google-appengine/browse_thread/thread/3721e262f1975934

I suspect there will be a growing number of bugs in apps by people not
realizing their put overrides aren't actually being called.
--~--~-~--~~~---~--~~
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: Looking for help to finish a new model to catch datastore timeouts

2009-01-16 Thread Devel63

Be aware that calls to db.put() will not call your db.Model.put()
override.  So if you are trying to be efficient by making several puts
at once via db.put([objlist]), your override will not be called.

I wish I knew how to solve this, but I don't.  I hope someone can tell
both of us what the preferred method for handling a put override is.

On Jan 16, 6:16 am, "bowman.jos...@gmail.com"
 wrote:
> Thanks for both links. I think I need to go back over that site. That
> page on exceptions was much better than the book I bought.
>
> On Jan 15, 6:28 pm, Alexander Kojevnikov 
> wrote:
>
> > > Oh ok.. so it is possible to catch that. It's datastore.Timeout and
> > > not db.Timeout, right? I was confused because when I see it in the
> > > logs I saw: raise _ToDatastoreError(err), so I wasn't sure how to
> > > catch it since that exception covers pretty much any issue with
> > > writing to the datastore, not just timeouts.
>
> > Actually google.appengine.ext.db.Timeout and
> > google.appengine.api.datastore_errors.Timeout is the same class, check
> > google/appengine/ext/db/__init__.py, line 105.
>
> > db.Timeout is documented here [1], the one from datastore_errors is
> > not a part of documented public API and thus can change. It's safer to
> > use db.Timeout in your code.
>
> > [1]http://code.google.com/appengine/docs/datastore/exceptions.html
>
> > > (Sorry, I didn't start using python until I started using
> > > appengine, so still learning here)
>
> > Neither did I :) You can skim through the chapter of the tutorial that
> > covers exceptions, it's pretty short and very well 
> > written:http://www.python.org/doc/2.5.2/tut/node10.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: Please help me upload my app. Using authenticated proxy server. ( urllib2 doesn't support https connection ) .

2009-01-16 Thread ramu

No reply yet ...

Anyway I got things working after so much searching and reading . Here
is the way I upload my test app for 1st time. I am putting the same
here so that if anyone else have same problems .. should get a way
out. There may be other BETTER methods unknown to me but this worked .

My constrains :

1.I access internet using an authenticated proxy server. Currently
appcfg.py doesn't seem to have a fascility to support authenticated
proxy ( atleast documentation is not there ).
My solution : I installed a local proxy server on my own computer and
set the internet options to pass through it. It made the
authentication by itself. the software I used is trial version of
CCProxy.

2.Even that this https support through proxy by urllib2 is ...
well I don't know.
My solution : This one was a bit adventurous.After reading the error
logs I traced back the function in appcfg.py which was always failing.
It is around line number 166 .

 def _GetAuthToken(self, email, password):

This need to return an AuthToken provided by google client login API.
This alwasy failed bcz abover reason. I found a cool way out in the
google group of client login API. I created a simple html page with
follwing content.



http://www.w3.org/1999/xhtml";>



Untitled Document





Following Form Generates Auth Key to be used for Google app engine.

https://www.google.com/accounts/ClientLogin";
method="post" enctype="application/x-www-form-urlencoded">





 






Putting your google account and password in this page returns your
Auth token very nicely. ( Firefox 3.0.0.5 ) .
Now copied this auth token and replaced the whole content of above
function to just return this value.Than ... OMG ... It worked. YES IT
WORKED.

Put a guest post in my test app.

http://developmentstageholder.appspot.com/



On Jan 15, 5:20 am, ramu  wrote:
> Sorry for the 2nd post with similar topic, but this seems to be the
> final answer with my limited python knowledge. I access internet
> through my institute basic authentication proxy. It took me a lot to
> figureout how to input my username and password. As the documentation
> only says how to input the proxy, which also seems not to be working .
> It dosen't tell where to put proxy username and password.
>
> The method I found out to use authentication proxy is :
>
> http://stackoverflow.com/questions/34079/how-to-specify-an-authentica...
>
> Appended the lines from above at the top of appcfg.py. Even than it
> would not work. Again searching on net .. and the horrible truth seems
> to invade me ... """Currently urllib2 does not support fetching of
> https locations through a proxy. This can be a problem.""". Https is
> necessary for google username and password communication.
>
> above quote at :
>
> http://www.voidspace.org.uk/python/articles/urllib2.shtml#proxies
>
> I request google app engine developers to device any other method to
> upload the files .I web browser based method should work for all.
>
> 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: Trouble with NeedIndexError when calling count()

2009-01-16 Thread Tony Arkles

I thought I would post our findings and solution. Our issue seems
slightly different.

We had entities similar to the following:

class Account(db.Model):
  ...

class AccountEntry(db.Model):
  account = db.ReferenceProperty(Account)
  tags = db.StringListProperty()
  utime = db.DateTimeProperty()
...

We had the following index in index.yaml, which was generated by
dev_appserver (for another gql query) and deployed to appspot
successfully:


- kind: AccountEntry
  properties:
  - name: account
  - name: tags
  - name: utime
direction: desc

However, once enough 'AccountEntry' entities where created, the
following gql query:


AccountEntry.gql("WHERE account = :1 AND tags = :2", account,
tag).count(100)

raised the "NeedIndexError: The built-in indices are not efficient
enough for this query and your data. Please add a composite index for
this query." error.

The problem was solved by manually adding the following index to the
index.yaml:


- kind: AccountEntry
  properties:
  - name: account
  - name: tags

since dev_appserver did not automatically generate this index for us
when the above query is executed.

Cheers
Tony


On Jan 9, 3:32 pm, Ryan W  wrote:
> Thanks for the explanation.  I was trying to avoid any
> __search_text_index indexes as you suggest, to get around the 1 per
> each number of keywords, so I didn't use any equality or sorts.  It
> usually works fine, and is again today as far as I can tell.  It
> must've been been something with the particular search query being
> done.  I've tried to set it up to capture/log errors better.
>
> Hopefully the full text solution is on its way soon.
>
> On Jan 9, 10:30 am, ryan  wrote:
>
> > hi guys! "merge join" queries like these, ie queries that have equals
> > filters on multiple properties but no inequality filters or sort
> > orders, *usually* don't require an index. that's described 
> > inhttp://code.google.com/appengine/docs/datastore/queriesandindexes.htm...
> > .
>
> > however, in cases with unusually shaped data, these queries can
> > sometimes require an index. these cases are exceedingly rare, but
> > they're somewhat more common with apphosting.ext.search.
>
> > also, you need an index for each number of keywords that you expect in
> > a query. for example, if you support three-word search queries, you
> > need this index:
>
> > - kind: Post
> >   properties:
> >   - name: __searchable_text_index
> >   - name: __searchable_text_index
> >   - name: __searchable_text_index
> >   - name: approved
>
> > more in the ext.search 
> > docstring,http://code.google.com/p/googleappengine/source/browse/trunk/google/a...
> > . also, unfortunately, these kinds of indices are likely to explode,
> > as described 
> > inhttp://code.google.com/appengine/docs/datastore/queriesandindexes.htm...
> > .
>
> > the upshot of all of this, as we've mentioned before, is that
> > appengine.ext.search is a hack. it's not scalable, mature, or anywhere
> > near industrial strength, which is why it's not officially supported
> > or documented. we're well aware that it's not good enough, and we
> > dearly hope to offer a real full text search solution in the future. i
> > don't have any details or timeline, though.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: How to match in query?

2009-01-16 Thread Nick Johnson

If all you want to do is retrieve the entity with a specific key,
Person.get(key) is much faster and simpler.

-Nick Johnson

On Jan 16, 6:24 am, Alexander Kojevnikov 
wrote:
> > I am messing with google app engine queries being very new to it
> > how can we match a string with __key__
> > 'SELECT * FROM Person WHERE __key__=:bkey', bkey=str(value)
> > This query is not working
> > What is wrong with this?
>
> You need to pass an instance of db.Key class as a parameter.
>
> Is 'value' a string representation of the key? If so, the code will
> look like this:
>
> query = db.GqlQuery('SELECT * FROM Person '
>                     'WHERE __key__ = :bkey',
>                     bkey=db.Key(value))
>
> See 
> alsohttp://code.google.com/appengine/docs/datastore/queriesandindexes.htm...
--~--~-~--~~~---~--~~
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: Setting up an Initialiser

2009-01-16 Thread Andy Freeman

> class Auction(db.Model):
>
> title = db.StringProperty()
> description = db.StringProperty()
>
>  def __init__(self, title, desc):
>   self.title = title
>   self.desc = desc
>
> This code is trimmed down from the full version, could you tell me if
> im doing anything fundamentally wrong with the __init__ function.

Yes, you are doing something fundamentally wrong.  If you define an
__init__ function, db.Model's __init__ won't be called unless you call
it and things won't work if db.Model's __init__ isn't called.

Instead, you want something like

  def __init__(self, *args, **kwds):
   {your code}
   super(Auction, self).__init__(*args, **kwds)
   {more of your code}

For example, {your code} could include "kwds.setdefault("title",
"default title")"  (Yes, this is the dumb/wrong way to do default
values.)

If you have named arguments, make sure that you pass the right
information to the super's __init__.

Note also that your __init__ will be called when the runtime
constructs an Auction, as it does for query and get results.

FWIW, it's likely that you shouldn't be writing your own __init__
function.




On Jan 16, 8:02 am, eli  wrote:
> Hi,
>
> I cant complete something seemingly very simple.
> I simply want to create the following object (Auction)
>
> auction =Auction(title, desc)
>
> class Auction(db.Model):
>
>     title = db.StringProperty()
>     description = db.StringProperty()
>
>      def __init__(self, title, desc):
>           self.title = title
>           self.desc = desc
>
> This code is trimmed down from the full version, could you tell me if
> im doing anything fundamentally wrong with the __init__ function.
>
> Thank you for your time,
>
> Elliott
>
> App Engine reports:
> AttributeError: 'Auction' object has no attribute '_entity'
--~--~-~--~~~---~--~~
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: Setting up an Initialiser

2009-01-16 Thread Elliott Rosenthal

Yes of course!
 :) Thank you for the help.

Saved me a lot of sweat.

2009/1/16 Qian Qiao :
>
> On Sat, Jan 17, 2009 at 02:02, Elliott Rosenthal
>  wrote:
>>
>> Thank you for the help so far, it really has been useful.
>> If there any way you could give me a quick snippet of code to show me
>> how to build a factory method?
>
> Let's say we have a model that models a circle, and you were to
> calculate the area of the circle in your __init__ method, we can use
> the following as an alternative:
>
> class Circle(db.Model):
>  centre = db.GeoPtProperty()
>  radius = db.IntegerProperty()
>  area = db.FloatProperty()
>
>  @staticmethod
>  def build_circle(centre, radius):
>area = math.pi * radius * radius # example of the complex calculation
>return Circle(centre = centre, radius = radius, area = area)
>
> So when you need a circle somewhere in you code, instead of creating
> it like circle = Circle(centre, radius), you do it as: circle =
> Circle.build_circle(centre, radius)
>
> HTH
>
> -- Joe
>
> >
>

--~--~-~--~~~---~--~~
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: Entities question

2009-01-16 Thread Bill

> I'm not sure I've followed you with whole Ownership model..
> Isn't that a RDBMS approach to the data and not BigTable's?

The two approaches aren't mutually exclusive.  In the case of User <->
CD, a User can have thousands or more CDs and a CD could be purchased
by millions.  Under those circumstances, storing the ownership
relationship in a list of references under either User or CD entities
will really impact performance.

In Rafe Kaplan's article he says:
"Another more important one is that you want to avoid storing overly
large lists of keys in a ListProperty."

The straightforward alternative is a separate Ownership model and now
there's a separate issue of constructing a transaction that handles
updating your genre counter upon a successful Ownership change.

It'll be interesting if someone comes up with another approach, maybe
using multiple User entities (under one entity group) that all map to
a single user, with each User entity holding a subset of all the CDs
and genre counters.

--~--~-~--~~~---~--~~
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: Setting up an Initialiser

2009-01-16 Thread Qian Qiao

On Sat, Jan 17, 2009 at 02:02, Elliott Rosenthal
 wrote:
>
> Thank you for the help so far, it really has been useful.
> If there any way you could give me a quick snippet of code to show me
> how to build a factory method?

Let's say we have a model that models a circle, and you were to
calculate the area of the circle in your __init__ method, we can use
the following as an alternative:

class Circle(db.Model):
  centre = db.GeoPtProperty()
  radius = db.IntegerProperty()
  area = db.FloatProperty()

  @staticmethod
  def build_circle(centre, radius):
area = math.pi * radius * radius # example of the complex calculation
return Circle(centre = centre, radius = radius, area = area)

So when you need a circle somewhere in you code, instead of creating
it like circle = Circle(centre, radius), you do it as: circle =
Circle.build_circle(centre, radius)

HTH

-- Joe

--~--~-~--~~~---~--~~
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: Setting up an Initialiser

2009-01-16 Thread Elliott Rosenthal

Thank you for the help so far, it really has been useful.
If there any way you could give me a quick snippet of code to show me
how to build a factory method?


2009/1/16 Qian Qiao :
>
> On Sat, Jan 17, 2009 at 01:49, Elliott Rosenthal
>  wrote:
>>
>> What about if I wish to initialise the variables inside the class with
>> a complex calculation?
>> The default parameter wont suffice, is there any other way?
>
> Define a factory method that builds the model?
>
> -- Joe
>
> >
>

--~--~-~--~~~---~--~~
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: Setting up an Initialiser

2009-01-16 Thread Qian Qiao

On Sat, Jan 17, 2009 at 01:49, Elliott Rosenthal
 wrote:
>
> What about if I wish to initialise the variables inside the class with
> a complex calculation?
> The default parameter wont suffice, is there any other way?

Define a factory method that builds the model?

-- Joe

--~--~-~--~~~---~--~~
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: Setting up an Initialiser

2009-01-16 Thread Elliott Rosenthal

What about if I wish to initialise the variables inside the class with
a complex calculation?
The default parameter wont suffice, is there any other way?

2009/1/16 djidjadji :
>
> If you look at the example at
>
> http://code.google.com/appengine/docs/python/gettingstarted/usingdatastore.html
>
> you see that you don't write an __init__() method if you subclass from
> db.Model or db.Expando.
> db.Model.__init__() will take care of assigning the correct attributes.
>
> >
>

--~--~-~--~~~---~--~~
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: Setting up an Initialiser

2009-01-16 Thread djidjadji

If you look at the example at

http://code.google.com/appengine/docs/python/gettingstarted/usingdatastore.html

you see that you don't write an __init__() method if you subclass from
db.Model or db.Expando.
db.Model.__init__() will take care of assigning the correct attributes.

--~--~-~--~~~---~--~~
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: Setting up an Initialiser

2009-01-16 Thread Qian Qiao

On Sat, Jan 17, 2009 at 00:02, eli  wrote:
>
> Hi,
>
> I cant complete something seemingly very simple.
> I simply want to create the following object (Auction)
>
> auction =Auction(title, desc)
>
>
> class Auction(db.Model):
>
>title = db.StringProperty()
>description = db.StringProperty()
>
> def __init__(self, title, desc):
>  self.title = title
>  self.desc = desc

You don't generally need to touch the __init__ function of your
models, You use them like this:

class Auction(db.Model):
  title = db.StringProperty()
  description = db.StringProperty()

Then when you need your aution model, you just do:

auction = Auction(title="Title", description="description")

HTH.

-- Joe

--~--~-~--~~~---~--~~
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: Data Privacy

2009-01-16 Thread Marzia Niccolai

Hi,

First let me say that everyone on the App Engine team takes data
privacy very seriously, and point you to Section 6 and 8 of the App
Engine terms of service (http://code.google.com/appengine/terms.html)
that deal explicitly with the issue of data ownership and copyright.

Also, it is important to note that the only Google employees who have
the ability to access data pertaining to any App Engine app are
certain members of the App Engine engineering team, and the access is
limited to that which is necessary to perform their job role.

The _only_ circumstances under which a member of the App Engine team
would access your application code and/or data is:

- With the developer's permission, in order to troubleshoot a specific issue
- If your application is causing system wide instability

Any modification to your app through the Admin Console (by any person)
is logged in the Admin Logs, that can be access at:
http://appengine.google.com/adminlogs?&app_id=YOURAPPID
Access logs are maintained by Google as well.

-Marzia

On Wed, Jan 14, 2009 at 1:06 PM, hawkett  wrote:
>
> Hi,
>
>   Just wanted to query the privacy policy, especially as it relates
> to code.  Would I be right in thinking that the only thing stopping
> google stealing an app. or an idea for an app, or an algorithm or data
> structure or whatever, is that you are such good guys?
>
>This is the privacy policy I am reading - 
> http://code.google.com/appengine/privacy.html
>
>I read the privacy policy to pretty much say you can do what you
> want with the code? i.e. 'We use this information internally to
> deliver the best possible service to you...' - you could interpret
> that to mean pretty much anything, including ripping off an idea and
> serving it back to us - (yeah, I know you are good guys).
>
>   A second question would be Google's policy for employees or
> contractors etc. looking at the code of app engine apps?  Are there
> any internal controls?  Do you maintain access logs?  What are your
> criteria?
>
>   An obvious situation would be a google employee reading a group
> post, and saying 'Hey that's an interesting point, I wonder what app
> they are building... let me just go in and look at their code... wow
> that's cool... ... hey boss I have an idea for my 20% spare
> time, how about we do this  recently>' - can you confirm that this does or does not happen?
>
>   It doesn't even need to be conscious - knowledge is knowledge, and
> you can't 'unsee' something.  I challenge anyone to see something done
> in a better way, and then continue to do it in an inferior way,
> because they are a 'good guy'.
>
>   It might just be a good idea to you, but it is IP and business
> value that you shouldn't have access to.  It is a significant barrier
> to GAE adoption for many organisations.  It is completely different
> situation on a platform like Amazon (because I can protect my content
> myself, among other things), and GAE requires a different policy than
> 'to provide a quality service'.
>
>   I realise this is covered by 
> http://code.google.com/p/googleappengine/issues/detail?id=501,
> which is an absolutely crucial issue that, naturally, has no input
> from google apart from acknowledgement.  I'm not writing this post to
> register my support of that issue, I've already done that.  I'm
> writing it to try and get some sort of meaningful response form
> Google.
>
>   Would someone at Google please be able to elaborate?  When do you
> access our code?  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] Setting up an Initialiser

2009-01-16 Thread eli

Hi,

I cant complete something seemingly very simple.
I simply want to create the following object (Auction)

auction =Auction(title, desc)


class Auction(db.Model):

title = db.StringProperty()
description = db.StringProperty()

 def __init__(self, title, desc):
  self.title = title
  self.desc = desc

This code is trimmed down from the full version, could you tell me if
im doing anything fundamentally wrong with the __init__ function.

Thank you for your time,

Elliott


App Engine reports:
AttributeError: 'Auction' object has no attribute '_entity'

--~--~-~--~~~---~--~~
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: Google Android developer curious about app engine

2009-01-16 Thread Geoffrey Spear

Yes, you just need to use Google Apps rather than signing up for a
personal Sites account.

On Jan 16, 10:02 am, madcoder  wrote:
> I'm impressed with what Google has done with their sites project!  It
> looks as though they have made site development easy, WYSIWYG-style.
>
> It seems to be perfect for what I'm looking for.  A question about it
> though.  Can I have my URL (e.g.,www.example.com) go to my Google
> Site?  I found this:
>
> Google Apps administrators can change the URL for any public site in
> Google Sites. Using "example.com" as the example domain, and example-
> site as the site, the standard URL for a site 
> is,http://sites.google.com/a/example.com/example-site. This could be
> changed tohttp://www.example.comthrough the Google Apps control
> panel.
>
>    1. Access the Site Settings screen in the Google Apps control panel
>    2. Select the "Web Address mapping" tab
>    3. Select "Add a new web address"
>    4. Enter the location of the site you want to map (example-site in
> the example above)
>    5. Enter the sub-domain you wish to map it to (www in the example
> below)
>    6. Select add mapping and follow the instructions provided.
> Depending on your domain registrar you might need to make CNAME
> changes. You will be provided directions after you select "Add
> mapping" to do this if required.
>
> Note: there can be up to a 24 hour delay for these changes to
> propagate.
>
> This can be done for private sites as well, but users will be
> redirected to the standard URL. So users could access a private site
> viahttp://private-wiki.example.combut would be redirected to the
> standard URL ofhttp://sites.google.com/a/example.com/private-wiki.
>
> So am I able to have my (already purchased) domain name go
> automatically go to my Google generated site, or is this not possible?
>
> Thanks for the great tip, I'll be looking further into it.
--~--~-~--~~~---~--~~
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: Mathematical calculations in query

2009-01-16 Thread Barry Hunter

Which is percisely what is not supported.

Imagine for a minute that the datastore supported it, it would work
quite well with say 100 records. Even 1000 records might work at a
push, but once you start getting to about 10,000 the datastore would
almost certainly start to cry, and soon fall apart.

Remember to calculate the distance the datastore has to run that
calculation on EVERY row, and the datastore is a distributed system.
To load the two properties for the calculation has to fetch the whole
row from bigtable - this has to be transfered to somewhere central to
do the calculations, and to a *single* place to do the sorting.
That is a LOT of information transfer for potentially a small amount
of actual data.

A traditional SQL database makes this sort of query almost trvial, and
again for small databases can work quite well - mainly because they
have the data stored squentially in once place so it can load it
quickly. But start getting into the thousend of results, and the
performance is going to suck.

The datastore maintains reasonable performance simply because it makes
heavy use of indexes, probably every query uses an index. A full table
scan even uses an index. But this sort of query cant make use of an
index in the traditional sense.

If the number of results is less than 1000 (either because that is all
you got, or you filtered to that number) then you can do the
calculation and sorting in the application. But in practice, probably
100-200 is a maximum - so you need to aggressively filter.

Should of pointed you at it before but see:
http://code.google.com/p/geodatastore/
that shows some of the practical implementations. But it quickly gets
beyond trivial, which is why I lost interest in the project.


You should also star
http://code.google.com/p/googleappengine/issues/detail?id=105
to encourage Google to add a Spatial  index type for GeoPt.
(Google have obviouslly figured it out internally with Google Base and
Google Maps (which may use Base) )


2009/1/16 arnie :
>
> I can limit records returned through query to say 15 or 20 or 25 rows
> but my problem is that the calculation that i needs to do on returned
> records needs results with distance in ascending order. It may be that
> in first 25 rows, there may be distances that are greater than the
> distances calculated in subsequent fetching. That's why I am looking
> for a way to do calculatin in query and then order by ASC. This is
> happening because the table only contains info about businesses like
> name, physical address, latitude, longitude and using the latitude and
> longitude as provided in request we haave to calculate distance in
> miles and then sort the results in ascending order of distances
> Thanks
> >
>



-- 
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: Google Android developer curious about app engine

2009-01-16 Thread madcoder

I'm impressed with what Google has done with their sites project!  It
looks as though they have made site development easy, WYSIWYG-style.

It seems to be perfect for what I'm looking for.  A question about it
though.  Can I have my URL (e.g., www.example.com ) go to my Google
Site?  I found this:

Google Apps administrators can change the URL for any public site in
Google Sites. Using "example.com" as the example domain, and example-
site as the site, the standard URL for a site is,
http://sites.google.com/a/example.com/example-site. This could be
changed to http://www.example.com through the Google Apps control
panel.

   1. Access the Site Settings screen in the Google Apps control panel
   2. Select the "Web Address mapping" tab
   3. Select "Add a new web address"
   4. Enter the location of the site you want to map (example-site in
the example above)
   5. Enter the sub-domain you wish to map it to (www in the example
below)
   6. Select add mapping and follow the instructions provided.
Depending on your domain registrar you might need to make CNAME
changes. You will be provided directions after you select "Add
mapping" to do this if required.

Note: there can be up to a 24 hour delay for these changes to
propagate.

This can be done for private sites as well, but users will be
redirected to the standard URL. So users could access a private site
via http://private-wiki.example.com but would be redirected to the
standard URL of http://sites.google.com/a/example.com/private-wiki.


So am I able to have my (already purchased) domain name go
automatically go to my Google generated site, or is this not possible?

Thanks for the great tip, I'll be looking further into it.


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

2009-01-16 Thread Qian Qiao

On Fri, Jan 16, 2009 at 04:12, Daniel O'Brien (Google)  wrote:
> [snip]
> The newly appointed Gurus are:
>
>  - Alexander Kojevnikov
>  - Bill Katz

Congratulations Alexander and Bill. Really nice to see their
contributions recognized by the mass.

-- Joe

--~--~-~--~~~---~--~~
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] Is there any plan or schedule to support naked name

2009-01-16 Thread zitiger

I try to create a site similar with tinyurl.com, but i found i can not
use a naked
domain. If i use www.mydomain.com, it seems that is too long for me.

if you are also interesting in this feather, pls vote it at
http://code.google.com/p/googleappengine/issues/detail?id=777
--~--~-~--~~~---~--~~
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 Engine Gurus

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

I like it. Now lets hope people don't drive poor Alexander and Bill
crazy with questions. :)

On Jan 15, 7:36 pm, boson  wrote:
> Yay!  Both Alexander & Bill have been very helpful and knowledgeable.
> I'm glad to see the formal recognition and development of the GAE
> community.
>
> On Jan 15, 12:12 pm, "Daniel O'Brien (Google)" 
> wrote:
>
> > Hello everyone,
>
> > Some of you may have noticed the recent addition of a "guru" listing
> > at the top of our main groups page. We've selected a few top
> > contributors to the App Engine community to act as App Engine Gurus.
> > Gurus will continue to post normally in the group, but are now
> > officially noted for their excellent contributions. The gurus were
> > selected based on their eagerness to participate in the App Engine
> > community as a whole and their advanced knowledge of the API.
>
> > The newly appointed Gurus are:
>
> >   - Alexander Kojevnikov
> >   - Bill Katz
>
> > Google will continue posting normally alongside the gurus. Our primary
> > focus is to help developers using the API, and the gurus will help
> > with that focus by continuing to help provide knowledge and answers to
> > those who ask. Remember that this list isn't fixed. Gurus who stop
> > participating may be removed, and others who demonstrate the level of
> > expertise and willingness to participate may be added.
>
> > If anyone has any questions, feel free to reply, contact me directly,
> > or send a message to the group's owners list.
>
> > Daniel O'Brien
--~--~-~--~~~---~--~~
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: Looking for help to finish a new model to catch datastore timeouts

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

Thanks for both links. I think I need to go back over that site. That
page on exceptions was much better than the book I bought.

On Jan 15, 6:28 pm, Alexander Kojevnikov 
wrote:
> > Oh ok.. so it is possible to catch that. It's datastore.Timeout and
> > not db.Timeout, right? I was confused because when I see it in the
> > logs I saw: raise _ToDatastoreError(err), so I wasn't sure how to
> > catch it since that exception covers pretty much any issue with
> > writing to the datastore, not just timeouts.
>
> Actually google.appengine.ext.db.Timeout and
> google.appengine.api.datastore_errors.Timeout is the same class, check
> google/appengine/ext/db/__init__.py, line 105.
>
> db.Timeout is documented here [1], the one from datastore_errors is
> not a part of documented public API and thus can change. It's safer to
> use db.Timeout in your code.
>
> [1]http://code.google.com/appengine/docs/datastore/exceptions.html
>
> > (Sorry, I didn't start using python until I started using
> > appengine, so still learning here)
>
> Neither did I :) You can skim through the chapter of the tutorial that
> covers exceptions, it's pretty short and very well 
> written:http://www.python.org/doc/2.5.2/tut/node10.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: ZipImport may import the library or may decide not to do so... (?!)

2009-01-16 Thread Waldemar Kornewald

Hi Moritz.

On Jan 16, 3:41 am, Moritz Angermann 
wrote:
> zipimporter('/base/data/home/apps/journal-ma/
> reflection-2.330732104263667843/libz/jinja2.zip', '')
> zipimporter('/base/data/home/apps/journal-ma/
> reflection-2.330732104263667843/libz/werkzeug.zip', '')
> : cannot import name BaseRequest
> Traceback (most recent call last):
>   File "/base/data/home/apps/journal-ma/
> reflection-2.330732104263667843/main.py", line 17, in 
>     from werkzeug import BaseRequest, BaseResponse, responder
> : cannot import name BaseRequest
>
> It looks like both libraries werkzeug and jinja2 got imported by the
> zipimporter but trying to import from them
> raises an ImportError.

Maybe this is related to:
http://code.google.com/p/googleappengine/issues/detail?id=988

Bye,
Waldemar Kornewald
--~--~-~--~~~---~--~~
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: Entities question

2009-01-16 Thread Chen Harel

Hi,
I'm not sure I've followed you with whole Ownership model..
Isn't that a RDBMS approach to the data and not BigTable's?

Regarding the genres, they are fixed (53 to be exact) and he can't
select new genres that aren't in the predefined list.

Regarding the counter entity, this is basically what I have today,
Simply that instead of using a ListReference I will save the string
'trance' to a ListStringProperty...
So I can get for a cd the tuple: "name:world music 2008 genres:[indy,
house, foreign]"


On Jan 16, 11:54 am, Bill  wrote:
> You could do an entity that has 50 genre counters.
>
> Some thoughts:
>
> 1) It seems like you can make genre part of a list property in a CD
> since each CD will only be a small number of genres.
>
> 2) I wouldn't use a Reference List for a User entity, because a User
> might have thousands of CDs.  See Rafe Kaplan's article on modeling
> entity relationships (http://code.google.com/appengine/articles/
> modeling.html).    I'd model the User <-> CD relationship with a
> separate Ownership entity that has key references to a CD and User
> entity.  You could add additional info into this relationship model,
> like whether the Owned CD has been lent to another User.
>
> 3) Are genres fixed or user-configurable (like a "tag" instead of a
> universal genre)?  If they are like tags and user-configurable, you
> could but the genre list in each Ownership entity.  Then if User X
> wants to know how many "1980s Top Hits" he owns, you could query the
> Ownership entities.  You could then memcache the (User, Genre, #CDs
> for genre) tuple instead of keeping 50 counters in User and just query
> again if needed.
>
> -Bill
>
> On Jan 15, 2:23 am, Chen Harel  wrote:
>
> > Hi, In case I want to represent a music album datastore,
> > I wish the user can add a cd that he likes (no need for information
> > other than cd name and genres)
> > Now, at first I looked at it as a RDBMS even in BigTable, meaning I
> > had
> > User entity
> > CD entity
> > Genre entity
> > With list of refrences keys...
> > Now after playing with it, I realized (at least I think so) that I am
> > killing my application,
> > Since I need to be able to supply the aggregations on "how many R&B
> > cd's user XXX has"
> > this query can't be optimized (at least with my current knowledge) on
> > BigTable,
> > So I need to start putting up counters... but I am questioning you
> > about the number of properties allowed (or make sense)
> > If I support 50 genres, can I simply do an entity that has:
> > User:
> >   id
> >   name
> >   cds (list of refrences)
> >   total_cd_counter
> >   trance_cd_counter
> >   house_cd_counter
> >   rnb_cd_counter
> >   .. (47 more counters)
>
> > And when I add / remove a cd for a user, I shall update the
> > appropriate counter ...
> > This will make query for the favorite genre (which is the main goal :)
> > - Sorry I got to it only here) of the application...
>
> > Please tell me if this will work, and will have sufficient
> > performance / scaling capabilities...
--~--~-~--~~~---~--~~
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: WYSIWYG Editor for App Engine

2009-01-16 Thread Bill

I would agree with Alexander that solid HTML/CSS knowledge is
important, particularly if you are using another person's template and
trying to add your own elements.  CSSEdit has some good reviews for
Mac HTML/CSS tweaking.  I mostly use TextMate and Firefox.

Adobe Dreamweaver does WYSIWYG HTML design and I believe there are
some server-side plugins, but probably not for anything App Engine
yet.

On Jan 15, 1:30 am, Alexander Kojevnikov 
wrote:
> The thing is, there's no substitute for a solid html/css knowledge. No
> visual html editor, and there are lots of them floating around, will
> produce a consistently valid and cross-browser compatible mark-up.
>
> Your best bet is to learn the basics, or to hire someone else to do
> the job.
>
> On Jan 15, 6:05 pm, Ashu  wrote:
>
> > Ok, so I am writing my application in
> > 1) Python
> > 2) Using the Default WebApp Framework (app engine).
> > 3) Initially used Notepad++ (also configured Eclipse IDE) as the
> > Editor
>
> > I also downloaded a free html template from the web and currently
> > using that to display my data/content. However, I also need to
> > customize some of the pages to take user input(aka add HTML Form
> > elements). I did add them up, but it kind of screws up the look and
> > feel of the page. I am still trying to work with CSS/HTML. So, I was
> > wondering if there was a Visual Tool/plugin that I could use to design
> > my pages by drag/drop and then connect it with my Python code.
>
> > On Jan 13, 3:54 am, Roberto Saccon  wrote:
>
> > > there are tools and plugins for everything available on the Internet.
> > > Make your question more precise. Is the editor for natural language or
> > > programming language (which one) ? If the later is the case, I
> > > recommend CodeMirror, it has pluggable parsers, is framework
> > > independent and if you look at the source code, it is one of the most
> > > amazing pieces of JavaScript I have seen in the last years (and it is
> > > also used at Google, but I forgot which project)
>
> > > regards
> > > Roberto
>
> > > On Jan 13, 7:21 am, Ashu  wrote:
>
> > > > I have coded up the necessary logic, but now I am stuck trying to come
> > > > with a descent looking Form to take input from the user. Are there any
> > > > plugins or tools available to get the HTML part coded with ease.
>
> > > > 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: Canwe share?

2009-01-16 Thread Greg

No. Probably the best solution is to set up a web service that your
wsgi apps access with the urlfetch API.

On Jan 15, 11:06 pm, arnie  wrote:
> Hi all
> Can we share same datastore tables [2 tables with 1-to many
> relationships] between more than one wsgi applications on GAE?
> Thanks
> Arnie
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Entities question

2009-01-16 Thread Bill

You could do an entity that has 50 genre counters.

Some thoughts:

1) It seems like you can make genre part of a list property in a CD
since each CD will only be a small number of genres.

2) I wouldn't use a Reference List for a User entity, because a User
might have thousands of CDs.  See Rafe Kaplan's article on modeling
entity relationships (http://code.google.com/appengine/articles/
modeling.html).I'd model the User <-> CD relationship with a
separate Ownership entity that has key references to a CD and User
entity.  You could add additional info into this relationship model,
like whether the Owned CD has been lent to another User.

3) Are genres fixed or user-configurable (like a "tag" instead of a
universal genre)?  If they are like tags and user-configurable, you
could but the genre list in each Ownership entity.  Then if User X
wants to know how many "1980s Top Hits" he owns, you could query the
Ownership entities.  You could then memcache the (User, Genre, #CDs
for genre) tuple instead of keeping 50 counters in User and just query
again if needed.

-Bill

On Jan 15, 2:23 am, Chen Harel  wrote:
> Hi, In case I want to represent a music album datastore,
> I wish the user can add a cd that he likes (no need for information
> other than cd name and genres)
> Now, at first I looked at it as a RDBMS even in BigTable, meaning I
> had
> User entity
> CD entity
> Genre entity
> With list of refrences keys...
> Now after playing with it, I realized (at least I think so) that I am
> killing my application,
> Since I need to be able to supply the aggregations on "how many R&B
> cd's user XXX has"
> this query can't be optimized (at least with my current knowledge) on
> BigTable,
> So I need to start putting up counters... but I am questioning you
> about the number of properties allowed (or make sense)
> If I support 50 genres, can I simply do an entity that has:
> User:
>   id
>   name
>   cds (list of refrences)
>   total_cd_counter
>   trance_cd_counter
>   house_cd_counter
>   rnb_cd_counter
>   .. (47 more counters)
>
> And when I add / remove a cd for a user, I shall update the
> appropriate counter ...
> This will make query for the favorite genre (which is the main goal :)
> - Sorry I got to it only here) of the application...
>
> Please tell me if this will work, and will have sufficient
> performance / scaling capabilities...
--~--~-~--~~~---~--~~
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: Google Android developer curious about app engine

2009-01-16 Thread djidjadji

If you know in advance that you only want to host static HTML content
you might have a look at

http://sites.google.com/

It is possible to host only static HTML in App Engine.
And when you later want to add some dynamic pages, based on database
content, you can add/change pages to serve this.

--~--~-~--~~~---~--~~
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] Generating cryptographically strong random numbers

2009-01-16 Thread Alexander Konovalenko

Web applications that implement user accounts need to generate
unpredictable values for session cookies and anti-CSRF tokens. So
several questions about App Engine arise:

1. How is os.urandom() implemented in production? That is, what
entropy sources does it use? What RNG algorithm?

2. Is there a supported way to obtain some high-entropy bits (like
/dev/random in Linux)?

3. Are there any features that could help us generate
cryptographically strong random numbers?

--~--~-~--~~~---~--~~
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: Mathematical calculations in query

2009-01-16 Thread arnie

I can limit records returned through query to say 15 or 20 or 25 rows
but my problem is that the calculation that i needs to do on returned
records needs results with distance in ascending order. It may be that
in first 25 rows, there may be distances that are greater than the
distances calculated in subsequent fetching. That's why I am looking
for a way to do calculatin in query and then order by ASC. This is
happening because the table only contains info about businesses like
name, physical address, latitude, longitude and using the latitude and
longitude as provided in request we haave to calculate distance in
miles and then sort the results in ascending order of distances
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
-~--~~~~--~~--~--~---