[google-appengine] 8 instances for a new launched website w/o many traffic, any clue...

2011-06-01 Thread maverick
We recently make public our newly developed GAE site: www.LOCQL.com,
it is a new location based Q&A to help user ask and answer questions
about places.  When we invited a few users yesterday, we noticed that
our instances suddenly went to 8 instance, and most of the instance
seemed to be idle there.

We are kind of worry if this is the case, under the new price model we
will have trouble!  Does anyone know what happened?  Our site does
have many data store operations, and so far during the test we didn't
turn on the cache, but we are still a bit surprise about this. Can
anyone visit our site and advice is there anything obviously wrong
there?  www.LOCQL.com, the site don't need to sign up, but we do need
you sign in with your facebook.

Thanks in advanced!

-- 
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] any one make django.contrib.sitemaps works in GAE?

2008-10-10 Thread maverick

This is what I get:  (GAE + Django 1.0 + Django helper)  looks like
something wrong in the model part which belongs to django...

---

AttributeError at /sitemap.xml

'ModelOptions' object has no attribute 'local_many_to_many'

Request Method: GET
Request URL:http://localhost:8080/sitemap.xml
Exception Type: AttributeError
Exception Value:

'ModelOptions' object has no attribute 'local_many_to_many'

Exception Location: D:\work\python\gaeprojects\myblog\django\db\models
\options.py in _fill_related_many_to_many_cache, line 403
Python Executable:  D:\Python25\python.exe
Python Version: 2.5.2
Python Path:['D:\\work\\python\\gaeprojects\\myblog', 'd:\\work\
\python\\gae', 'd:\\work\\python\\gae\\lib\\django', 'd:\\work\\python\
\gae\\lib\\webob', 'd:\\work\\python\\gae\\lib\\yaml\\lib', 'd:\\work\
\python\\gae', 'D:\\Python25', 'D:\\Python25\\DLLs', 'D:\\Python25\
\lib', 'D:\\Python25\\lib\\lib-tk', 'D:\\Python25\\lib\\plat-win', 'D:\
\Python25\\lib\\site-packages', 'D:\\Python25\\lib\\site-packages\
\Pythonwin', 'D:\\Python25\\lib\\site-packages\\win32', 'D:\\Python25\
\lib\\site-packages\\win32\\lib', 'D:\\Python25\\lib\\site-packages\
\wx-2.8-msw-unicode', 'F:\\Windows\\system32\\python25.zip', 'F:\
\eclipse\\plugins\\org.python.pydev_1.3.19\\PySrc']
Server time:Sat, 11 Oct 2008 01:36:07 +
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: CapabilityDisabledError: Datastore writes are temporarily disabled.

2008-11-15 Thread maverick

I have same problem, they are maintenance system right now, should be
fine in 20 min. :)



On Nov 15, 10:29 pm, Josh Heitzman <[EMAIL PROTECTED]> wrote:
> Good call.  Looks like there scheduled maintenance now 
> perhttp://groups.google.com/group/google-appengine-downtime-notify/brows...
>
> Josh
>
> On Nov 15, 2:24 pm, "russ.au" <[EMAIL PROTECTED]> wrote:
>
> > I'm getting this exception in my app engine app :
> > "CapabilityDisabledError: Datastore writes are temporarily disabled."
>
> > A search of this group suggest this only happens during scheduled
> > maintenance?http://groups.google.com/group/google-appengine/browse_thread/thread/...
>
> > The data viewer is also giving me a "Server Error".
>
> > Are other people seeing the same errors?
>
> > Russ
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] create_login_url(url) fail when input url contain unicode.

2008-11-22 Thread maverick

'ascii' codec can't encode characters in position 5-6: ordinal not in
range(128)

--#  /base/data/home/apps/psf/2.329473269902644098/
context_processors.py in gae_url

   1. from google.appengine.api import users
   2.
   3. def gae_url(request):
   4. params = {}

   5. params['sign_in'] = users.create_login_url(request.get_full_path
()) ...

   6. params['sign_out'] = users.create_logout_url
(request.get_full_path())
   7. return params


 138. Returns:
 139. string
 140. """
 141. req = user_service_pb.StringProto()
 142. resp = user_service_pb.StringProto()
 143. req.set_value(dest_url)
 144. try:

 145. apiproxy_stub_map.MakeSyncCall('user', 'CreateLoginURL', req,
resp) ...

 146. except apiproxy_errors.ApplicationError, e:
 147. if (e.application_error ==
 148. user_service_pb.UserServiceError.REDIRECT_URL_TOO_LONG):
 149. raise RedirectTooLongError
 150. else:
 151. raise e

▼ Local vars
VariableValue
dest_url
u'/tag/\u968f\u7b14/'
req

resp

# /base/python_lib/versions/1/google/appengine/api/
apiproxy_stub_map.py in MakeSyncCall

  39. response: protocol buffer for the response
  40.
  41. Raises:
  42. apiproxy_errors.Error or a subclass.
  43. """
  44. stub = apiproxy.GetStub(service)
  45. assert stub, 'No api proxy found for service "%s"' % service

  46. stub.MakeSyncCall(service, call, request, response) ...

  47.
  48.
  49. class APIProxyStubMap:
  50. """Container of APIProxy stubs for more convenient unittesting.
  51.
  52. Stubs may be either trivial implementations of APIProxy services
(e.g.

▶ Local vars
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: create_login_url(url) fail when input url contain unicode.

2008-11-22 Thread maverick

Fixed.
 users.create_login_url(request.get_full_path().encode('utf-8'))

add "encode('utf-8').


On Nov 22, 9:09 pm, maverick <[EMAIL PROTECTED]> wrote:
> 'ascii' codec can't encode characters in position 5-6: ordinal not in
> range(128)
>
> --#  /base/data/home/apps/psf/2.329473269902644098/
> context_processors.py in gae_url
>
>1. from google.appengine.api import users
>2.
>3. def gae_url(request):
>4. params = {}
>
>5. params['sign_in'] = users.create_login_url(request.get_full_path
> ()) ...
>
>6. params['sign_out'] = users.create_logout_url
> (request.get_full_path())
>7. return params
>
>  138. Returns:
>  139. string
>  140. """
>  141. req = user_service_pb.StringProto()
>  142. resp = user_service_pb.StringProto()
>  143. req.set_value(dest_url)
>  144. try:
>
>  145. apiproxy_stub_map.MakeSyncCall('user', 'CreateLoginURL', req,
> resp) ...
>
>  146. except apiproxy_errors.ApplicationError, e:
>  147. if (e.application_error ==
>  148. user_service_pb.UserServiceError.REDIRECT_URL_TOO_LONG):
>  149. raise RedirectTooLongError
>  150. else:
>  151. raise e
>
> ▼ Local vars
> VariableValue
> dest_url
> u'/tag/\u968f\u7b14/'
> req
>  0x9913b45f7e1f63b8>
> resp
>  0x9913b45f7e1f67a8>
> # /base/python_lib/versions/1/google/appengine/api/
> apiproxy_stub_map.py in MakeSyncCall
>
>   39. response: protocol buffer for the response
>   40.
>   41. Raises:
>   42. apiproxy_errors.Error or a subclass.
>   43. """
>   44. stub = apiproxy.GetStub(service)
>   45. assert stub, 'No api proxy found for service "%s"' % service
>
>   46. stub.MakeSyncCall(service, call, request, response) ...
>
>   47.
>   48.
>   49. class APIProxyStubMap:
>   50. """Container of APIProxy stubs for more convenient unittesting.
>   51.
>   52. Stubs may be either trivial implementations of APIProxy services
> (e.g.
>
> ▶ Local vars
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Date range overlapping query in Datastore

2008-12-23 Thread maverick

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

2008-12-25 Thread maverick

Thanks a lot! That's helpful!

On Dec 25, 1:58 am, Garrett Davis  wrote:
> 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] Query for related posts (from post title and tags) in GAE data store...

2008-12-26 Thread maverick

Hi,

  I am improving my own blog on GAE, one great feature wordpress (with
certain plugins) has is the "related posts", when you browse one post,
you can get the most relevant posts list. I took a quick look of some
wordpress's related plugin, them implement this feature based on
MySQL's full text retrieve functions.

  I am thinking of how to write a query to find the related posts from
a post's title and tags in GAE's data store.

  thanks,

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