[google-appengine] Re: GAE and Apps Marketplace

2010-03-10 Thread molicule
Hi,
The sso page here does not have any python openid libraries for the
marketplace??
http://code.google.com/googleapps/marketplace/sso.html

Is that an oversigght? is there any way a python google appengine app
can
participate in the marketplace??

Thanks
S. Sriram



On Mar 10, 9:56 am, Roberto Saccon rsac...@gmail.com wrote:
 I am planning to integrate an appengine hosted app on custom domain
 with the Apps Marketplace. Has anybody done that yet and has
 experiences to share ?

 One thing I am wondering about is whether the customer has to add on
 his Google Apps Admin Panel both, the Market place and the appengine
 app (and perform there optionally the domain-mapping), or if it could
 be handled all by just adding the Marketplace app.

 --
 Roberto

-- 
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-appeng...@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: All Read Please: Geographical Request Latency

2009-08-18 Thread molicule

Location: Los Altos, CA (10 mins from google-hq)
average latency: 170ms

If you are planning on collating/summarizing all this info, i'd
appreciate it if you
could send out a link to the summary.

- S.. Sriram


On Aug 13, 3:44 am, Martyn martyn.cutc...@googlemail.com wrote:
 Hi there,

 I am investigating request latency for AppEngine after experiencing
 significantly lower performance then reported in the Java status
 results.

 This appears to be due to network topology, but I thought it would be
 useful to get results from several locations worldwide.

 To that end I have created a simple version of an app I am working on,
 that provides request timings.  I would really appreciate it if people
 could take a minute, try the link out and report back on the results.

 Here is the link:http://performance.latest.pet-software.appspot.com

 many thanks in advance

 - Martyn
--~--~-~--~~~---~--~~
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: would multiple filters in a single query on the *same* StringListProperty result in an exploding index

2009-04-21 Thread molicule

Hi,

Thanks for the response.

Just to clarify,
if the query has an order by clause say order by date DESC
or
there is an inequality filter on a field 'other than' the
StringListProperty field
than
a composite index would be created which would lead to an exploding
index condition on
queries likewords=1, words=3, words=5 that might match a single row.

Also,
 for you). Note that if the data is too sparse (too many rows scanned without
 finding results), the merge-join query may quit and instruct you to use a
 custom index instead.


how is the above 'instruction' made?
Say I had 1 million rows each with a 500 item
StringListProperty and a query that would maybe match say 2 rows would
that trigger such an instruction.

Thanks
S. Sriram
--~--~-~--~~~---~--~~
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: regarding accessing list of values

2009-04-21 Thread molicule

Hi,

You have defined latitude and longitude as StringListProperty and are
passing it a string as opposed to
a list, either change the field type i.e. use GeoPt
http://code.google.com/appengine/docs/python/datastore/typesandpropertyclasses.html#GeoPt
or pass in a list
location.latitude.append(self.request.get('latitude') )

S. Sriram

On Apr 21, 5:42 am, shreevaishnav sagarshreevaish...@gmail.com
wrote:
 Hi,
    I want to append a value to the list in the database,dynamically
 from a html form , one value at each time in such a way that the new
 value is appended to the old one in the list and display on the web
 page in the database.How to link multiple entities in the
 datastore.How to make an attribute in an entity as unique.
 Please help me.

 I have the following code as below:

 import cgi
 from google.appengine.api import users
 from google.appengine.ext import webapp
 from google.appengine.ext.webapp.util import run_wsgi_app
 from google.appengine.ext import db

 class Route(db.Model):
  routenumber = db.StringProperty(unique=True )---unique could not be
 used
  routename = db.StringProperty()
  date = db.DateTimeProperty(auto_now_add=True)

 class Location(db.Model):
  reference = db.ReferenceProperty(Route)
  latitude = db.StringListProperty()
  longitude = db.StringListProperty()
  landmarkname = db.StringListProperty()
  date = db.DateTimeProperty(auto_now_add=True)

 class Current(db.Model):
  reference = db.ReferenceProperty(Route)
  currentlat = db.StringListProperty()
  currentlong = db.StringListProperty()
  date = db.DateTimeProperty(auto_now_add=True)

 class MainPage(webapp.RequestHandler):
  def get(self):

   self.response.out.write('htmlbodytable
 border=1trthRoutenumber/ththRoutename/th/tr')
   routes = db.GqlQuery(SELECT * FROM Route)

   for route in routes:
    self.response.out.write('trtdblockquote%s/blockquote/td'
 %
                            cgi.escape(route.routenumber))
    self.response.out.write('tdblockquote%s/blockquote/td/tr'
 %
                            cgi.escape(route.routename))
   self.response.out.write('/table/body/html')

   self.response.out.write('htmlbodytable
 border=1trthLatitude/ththLongitude/ththLandmarkname/th/
 tr')
   locations = db.GqlQuery(SELECT * FROM Location)

   for location in locations:
    #self.response.out.write('trtdblockquote%s/blockquote/td'
 %
                           # cgi.escape(route.routenumber))
     self.response.out.write('trtdblockquote%s/blockquote/td'
 %
                            cgi.escape(location.latitude))
     self.response.out.write('tdblockquote%s/blockquote/td' %
                            cgi.escape(location.longitude))
     self.response.out.write('tdblockquote%s/blockquote/td/
 tr' %
                            cgi.escape(location.landmarkname))
   self.response.out.write('/table/body/html')

   self.response.out.write('htmlbodytable
 border=1trthCurrentLatitude/ththCurrentLongitude/th/
 tr')
   currents = db.GqlQuery(SELECT * FROM Current)

   for current in currents:
    #self.response.out.write('trtdblockquote%s/blockquote/td'
 %
                            #cgi.escape(route.routenumber))
     self.response.out.write('trtdblockquote%s/blockquote/td'
 %
                            cgi.escape(current.currentlat))
     self.response.out.write('tdblockquote%s/blockquote/td/
 tr' %
                            cgi.escape(current.currentlong))
   self.response.out.write('/table/body/html')

   self.response.out.write(htmlbody
   form action=/sign method=post
   Routenumber :input type=text name=routenumber size=20br
   Routename   :input type=text name=routename size=20br
   Latitude    :input type=text name=latitude size=20br
   Longitude   :input type=text name=longitude size=20br
   Landmarkname:input type=text name=landmarkname size=20br
   Currentlat  :input type=text name=currentlat size=20br
   Currentlong :input type=text name=currentlong size=20br

   input type=submit value=Send

   /form
  /body
 /html)

 class Guestbook(webapp.RequestHandler):
  def post(self):
   route = Route()
   route.routenumber = self.request.get('routenumber')
   route.routename = self.request.get('routename')
   route.put()

   location = Location()
   location.latitude = self.request.get('latitude')
   location.longitude = self.request.get('longitude')
   location.landmarkname = self.request.get('landmarkname')
   location.put()

   current = Current()
   current.currentlat = self.request.get('currentlat')
   current.currentlong = self.request.get('currentlong')
   current.put()

   self.redirect('/')

 application = webapp.WSGIApplication([('/', MainPage),('/sign',
 Guestbook)],debug=True)

 def main():
  run_wsgi_app(application)

 if __name__ == __main__:
  main()Traceback (most recent call last):
   File C:\Program Files\Google\google_appengine\google\appengine\ext
 \webapp\__init__.py, line 498, in __call__
     handler.get(*groups)
   File C:\Program Files\Google\google_appengine\aitdatabase
 \database.py, line 

[google-appengine] would multiple filters in a single query on the *same* StringListProperty result in an exploding index

2009-04-11 Thread molicule

Hi,

If I have

class MyModel(db.Model):
 field1 = db.StringProperty()
 field2 = db.StringProperty()
 ..
 words = db.StringListProperty()

and one of the rows has
field1 = f1
field2 = f2
words =[list, with, five, hundred, words]

and query (a)
query = MyModel.all().filter(field1 =, f1).filter(field2 =,
f2).filter(words =, with).filter(words =, five).filter
(words =, words).fetch(10)
which should return the row above

or query (b)
query = MyModel.all().filter(field1 =, f1).filter(field2 =,
f2).filter(words =, with).filter(words =, five).filter
(words =, notinlist).fetch(10)
which should return no rows.

Would such a query result in an exploding index ?


Thanks
S. Sriram
--~--~-~--~~~---~--~~
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 one do a != on a StringListProperty

2009-04-10 Thread molicule

Hi,

In the example below, I have a StringListProperty 'stems' and
when I try to do a != I do not get the desired result. Where it should
fetch no
results it fetches two.


 for q in Mymodel.all().filter(stems !=, purpl).fetch(10): print q.stems
...
[u'blue', u'black', u'green', u'grei', u'purpl']
[u'blue', u'green', u'orang', u'violet', u'purpl']


What filter would I need to use to achieve the desired result ?

Thanks
S. Sriram

--~--~-~--~~~---~--~~
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: Dynamically retrieve the class of a Model object

2009-04-10 Thread molicule

if db._kind_map.has_key(pigeon):
   # do your thing

db._kind_map.keys() gives you the complete list

S. Sriram

On Apr 9, 6:40 pm, Stephen Cagle same...@gmail.com wrote:
 I have a collection of Model objects. I am wondering if there is any
 way to retrieve one of these Model objects dynamically, using nothing
 more than a string. As a example, say I had a Model object named
 Pigeon in my database, and I did not have a Model object named
 Pooridge. If I called mysteryFx(Pigeon) it would return the class
 reference to Pigeon, if I called mysteryFx(Pooridge) it would return
 None. Does anyone know the innards of mysteryFx?

 Note, I am not interested in importing every existent Model object,
 and then storing them in a dictionary or something like that. I want
 to ask AppEngine if it has a table (kind, whatever) that matches the
 provided string, and if it does, I want it to give me a reference to
 the class implementation that matches said table.

 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: Dynamically retrieve the class of a Model object

2009-04-10 Thread molicule

For class introspection check out
http://docs.python.org/library/inspect.html
and
http://www.ibm.com/developerworks/library/l-pyint.html

S. Sriram

On Apr 9, 6:40 pm, Stephen Cagle same...@gmail.com wrote:
 I have a collection of Model objects. I am wondering if there is any
 way to retrieve one of these Model objects dynamically, using nothing
 more than a string. As a example, say I had a Model object named
 Pigeon in my database, and I did not have a Model object named
 Pooridge. If I called mysteryFx(Pigeon) it would return the class
 reference to Pigeon, if I called mysteryFx(Pooridge) it would return
 None. Does anyone know the innards of mysteryFx?

 Note, I am not interested in importing every existent Model object,
 and then storing them in a dictionary or something like that. I want
 to ask AppEngine if it has a table (kind, whatever) that matches the
 provided string, and if it does, I want it to give me a reference to
 the class implementation that matches said table.

 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: Named groups in URL mappings regexp

2009-03-30 Thread molicule

Hi,

You need to change WSGIApplication.wsgi_call to support this.
Here is what I'm doing
1. create a new file gapngo/wsgi.py, like so
#!/usr/bin/env python
#

from google.appengine.ext.webapp import *
from google.appengine.ext.webapp.util import run_wsgi_app

def wsgi_call(self, environ, start_response):
Called by WSGI when a request comes in.
request = Request(environ)
response = Response()

# placeholder for middleware
request.blue = blue

WSGIApplication.active_instance = self

handler = None
groups = ()
for regexp, handler_class in self._url_mapping:
  match = regexp.match(request.path)
  if match:
handler = handler_class()
handler.initialize(request, response)
groups = match.groups()
kwargs = match.groupdict()
break

self.current_request_args = groups

if handler:
  try:
method = environ['REQUEST_METHOD']
if method == 'GET':
  handler.get(*groups, **kwargs)
elif method == 'POST':
  handler.post(*groups, **kwargs)
elif method == 'HEAD':
  handler.head(*groups, **kwargs)
elif method == 'OPTIONS':
  handler.options(*groups, **kwargs)
elif method == 'PUT':
  handler.put(*groups, **kwargs)
elif method == 'DELETE':
  handler.delete(*groups, **kwargs)
elif method == 'TRACE':
  handler.trace(*groups, **kwargs)
else:
  handler.error(501)
  except Exception, e:
handler.handle_exception(e, self.__debug)
else:
  response.set_status(404)

response.wsgi_write(start_response)
return ['']

def run_gapngo_app(application):
WSGIApplication.__call__ = wsgi_call
run_wsgi_app(application)

2. In your views make the following changes
import gapngo.wsgi as wsgi
.
def get(self, *args, **kwargs):
.
wsgi.run_gapngo_app(application)

3. Now access your named regex groups as kwargs.get(blah)

Also note there is a placeholder for calling middleware.

S. Sriram

On Mar 29, 1:46 pm, Tito bigt...@gmail.com wrote:
 I would like to use named groups in the regular expressions passed on
 to the webapp.WSGIApplication constructor.
 The main reason is that I need to pass HTTP parameters embedded in the
 URL in a different order than the positional parameters in the
 corresponding get() method of the RequestHandler class.

 Example:
 web_application = webapp.WSGIApplication([
   (r/xhtml/(?Poutput[^/]+)/wall/(?Puser_key[^/]+),
 messaging.WallPage),
 ])

 The output parameter represent the format of the page.
 The user_key parameter is an identifier for a particular application
 user.

 The signature of the get method  of the RequestHandler WallPage would
 be the following:
 def get(self,user_key, output=iphone)

 Even though I'm using named groups in the URL mapping, regexp matching
 groups are always passed as positional parameters to the get method,
 so they end up being swapped.

 Is it simply not supported or am I doing something wrong?

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