[google-appengine] Tutorial: How to manage Tags and Tag clouds with AppEngine and Django

2008-12-15 Thread xponrails

Hi. I'm a J2EE, Python and Rails developer.

I've just posted a tutorial (http://xponrails.net/wrblog/view_post/19)
on how to model and manage Tags in an AppEngine-Django application.

The code works well for me, but I would like to receive your feedback.

Cheers, Stefano


--~--~-~--~~~---~--~~
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: Tutorial: How to manage Tags and Tag clouds with AppEngine and Django

2008-12-15 Thread kang
great

On Mon, Dec 15, 2008 at 4:20 PM, xponrails stefac...@gmail.com wrote:


 Hi. I'm a J2EE, Python and Rails developer.

 I've just posted a tutorial (http://xponrails.net/wrblog/view_post/19)
 on how to model and manage Tags in an AppEngine-Django application.

 The code works well for me, but I would like to receive your feedback.

 Cheers, Stefano


 



-- 
Stay hungry,Stay foolish.

--~--~-~--~~~---~--~~
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: Ajax Updater parameters transfer

2008-12-15 Thread Matija

For '/update_tags/mark365'

Url mapping cloud be:

('/update_tags/(.*)', UpdateTags),

And class:

class UpdateTags(BaseRequestHandler):
   def get(self, mark):

Javascript:

function updateTags(mark){
   new Ajax.Updater('tagging_area', '/update_tags/' + mark, {
 method: 'get'
   });
}

For '/update_tags?mark=mark365'

('/update_tags.*', UpdateTags),

class UpdateTags(BaseRequestHandler):
   def get(self):
  mark = self.request.get('mark')

function updateTags(mark){
   new Ajax.Updater('tagging_area', '/update_tags?mark=' + mark, {
 method: 'get'
   });
}

For url '/update_tags' but with mark data in POST header

('/update_tags', UpdateTags),

class UpdateTags(BaseRequestHandler):
   def post(self):
   mark = self.request.get('mark')

function updateTags(mark){
   new Ajax.Updater('tagging_area', '/update_tags', {
 method: 'post',
 parameters: { 'mark':mark }
   });
}

Also your template file probably should be:

span class=itema href=javascript:updateTags({{mark}})b
{{mark}}/b/a/span

But good principle would be to separate presentation from behavior and
not to have html and javascript in same file. It depends of you
problem but something like:

span class=itema href=# class=marks id={{ mark }}strong
{{mark}}/strong/a/span

And in separate javascript file you need to have one more function
that is executed after html document downloaded:

this in html
script type=text/javascript
Event.observe(window, 'load', init);
/script

And javascript code in separate file

function init(){
   $$('.marks').each(function(linkMark){
   Event.observe(linkMark, 'click', updateTags);
   )};
}

function updateTags(mouseInfo){
   Event.stop(mouseInfo);
   var mark = mouseInfo.element().id; // or var mark =
mouseInfo.element().readAttribute('id');

   ... and here your preferred way of sending data.
}

Hope that helped. Matija.

P.S. There could be some writing errors.

On Dec 15, 7:09 am, Shay Ben Dov shay.ben...@gmail.com wrote:
 Hi,

 It should be '/update_tags/a' like when you use

 .?id={{ variable }}

 thanks,

 Shay


--~--~-~--~~~---~--~~
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: Avg CPU Megacycles of simple Python script to high

2008-12-15 Thread Matija

One write in bigtable datastore cost around 900 mcycles. One read cost
around 40 mcycles. You have one write and 10 reads and this reason why
it is 1252 avg.

There is no memcache that can help you with writing to datastore. Also
memcache can't help you in reading from datastore with standard design
(for desktop application, or even low (or expensive) scalable web
application).

Problem is in your expectation. There is probably no way in creating
cheep total scalable information system if you allow more than one
write per request.

To achieve under 1200 mcycles you need to think out of the box.
Transfer more programming logic to client side (javascript) and learn
some paging tehnics with app engine. Python code isn't expensive but
datastore operations are.

Try to read every article about app engine before you start to write
any code. My first request took around 7 mcycles, second design
15000 mcycles, and third and final design (after complete
documentation and group reading) is always under 1000 mcycles but now
instead of one web request I have more than 30 requests for same. With
smart memcache usage (for reading requests) you can have average web
request under 100 mcycles. It takes more time but when you achieve
this it is worthy.

My only problem with one write datastore operation per request is no
internal counter system. So when you implement shard counter principle
and divide this in two requests (one write plus one counter write) you
have possible problem when first write request finished nice and
second not.

So you should design your system not to depend too much on counter
information. Maybe some information purpose where 99% precision is
fine.

On Dec 14, 8:58 am, Thomas thomas.pels...@googlemail.com wrote:
 Hi all,

 I made a very simple performance test to find out, why my scripts
 reach the 1000 megacycle per request.

 1.) With template:

  Schnip

 import os
 from google.appengine.ext import webapp
 from google.appengine.ext import db
 from google.appengine.ext.webapp import template
 from google.appengine.ext.webapp.util import run_wsgi_app

 class User(db.Model):
   name = db.StringProperty(required=True)
   password = db.StringProperty(required=True)

 class MainHandler(webapp.RequestHandler):

   def get(self):
 new = User(
 name=Mandy,
 password=MM
   )
 new.put()

 template_values = {
   'query' : db.GqlQuery(SELECT * FROM User ORDER BY __key__ DESC
 LIMIT 10)
   }

 path = os.path.join(os.path.dirname(__file__), 'test2.html')
 self.response.out.write(template.render(path, template_values))

 def main():
 run_wsgi_app(webapp.WSGIApplication(
 [
 ('/test/', MainHandler)
 ])
 )

 if __name__ == '__main__':
 main()

 Schnap 

 The script uses a very simple template with html header (2 metatags
 und title) and an empty body. A test with 1000 requests, every 4
 seconds one, shows 1250 avg megacycles per request.

 2.) Without template

  Schnip
 from google.appengine.ext import webapp
 from google.appengine.ext import db
 from google.appengine.ext.webapp.util import run_wsgi_app

 class User(db.Model):
   name = db.StringProperty(required=True)
   password = db.StringProperty(required=True)

 class MainHandler(webapp.RequestHandler):

   def get(self):
 new = User(
 name=Mandy,
 password=MM
   )
 new.put()

 results = db.GqlQuery(SELECT * FROM User ORDER BY __key__ DESC
 LIMIT 10

 self.response.out.write('!DOCTYPE html PUBLIC -//W3C//DTD XHTML
 1.0 Strict//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd;')
 self.response.out.write('html xmlns=http://www.w3.org/1999/
 xhtml lang=de xml:lang=de')
 self.response.out.write('head')
 self.response.out.write('meta http-equiv=Content-Type
 content=text/html; charset=UTF-8 /')
 self.response.out.write('link href=/stylesheets/main.css
 rel=stylesheet type=text/css /')
 self.response.out.write('titleTEST2/title')
 self.response.out.write('/head')
 self.response.out.write('body')

 for result in results:
 self.response.out.write ('Name:'+ result.name + 'br')
 self.response.out.write ('Password:' + result.password +
 'br')
 self.response.out.write ('ID:' + str(result.key().id()) +
 'br')

 self.response.out.write('/body')
 self.response.out.write('/html')

 def main():
 run_wsgi_app(webapp.WSGIApplication(
 [
 ('/test2/', MainHandler)
 ])
 )

 if __name__ == '__main__':
 main()

 Schnap -
  A test with 1000 requests, every 4 seconds one, shows 1240 avg
 megacycles per request.

 3.) With DB-Query (NO GQL) + templates

 --- Schnip

 import os
 from google.appengine.ext import webapp
 from google.appengine.ext import db
 from google.appengine.ext.webapp import template
 from 

[google-appengine] Re: JSON help...

2008-12-15 Thread Matija

If you know that there will be always less then 20 categories (because
of request quota limit) code is simple. If it could be more, then you
need to implement some pageing tehnics.

What you need is something like this:


rez = {}
ctgs = []
i = 0
for ctg in Category.all()
   i += 1
   ctParent = {}
   ct = {}
   ct['name'] = ctg.name
   ct['id'] = ctg.id # I am not sure if it is possible to have
attribute id because of name collision, but try and see...
   ctParent[str(i)] = ct
   ctgs.append(ctParent)

rez = { categories_num: str(i), categories: ctgs }

self.response.headers['Content-Type'] = 'application/json'
self.response.out.write(demjson.encode(rez))

P.S. Why are you using demjson if you have already simplejson in
django.utils. Also this is good memcache candidate.

On Dec 13, 11:09 pm, TCH thecrocodilehunteronthe...@gmail.com wrote:
 hi im new to google appengine and webapp framework

 i have a model

 class Category(db.model):
name = db.StringProperty()

 i want to get all the entries in this model as json
 im using demjson

 i want it like this

 {
 categories_num: 15 (number of categories)
 categories: {
1: {
   name: automobile;
   id : 13,
}

2: {
   name: another;
   id : 2,
   }
  }

 }

 how can i get 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] Re: Data is skipped

2008-12-15 Thread koji matsui

Hi, djidjadji, thanks for your comment.

I tried both query as below:

query = models.Ownership.all().filter('user', user),filter('deleted',
False).order('-created_on').fetch(offset, amount)
query = models.Ownership.all().filter('user =', user),filter('deleted
=', False).order('-created_on').fetch(offset, amount)

But the definition of index sdk generates is exactly the same.
And lack of data in result set is the same.

So, I think this problem happens when server creates the index.

Thanks.

2008/12/15 djidjadji djidja...@gmail.com:

 A snippet from the manual
 ==
 filter(property_operator, value)

Adds a property condition filter to the query. Only entities with
 properties that meet all of the conditions will be returned by the
 query.

Arguments:

property_operator
A string containing the property name and a comparison
 operator. The name and the operator must be separated by a space, as
 in: age  The following comparison operators are supported:  = = =
 (The not-equal (!=) and IN operators are not supported.)
 ==

 You forget the comparison operator in your filter statements.


 2008/12/13 paptimus papti...@gmail.com:

 query = models.Ownership.all().filter('user', user),filter('deleted',
 False).order('-created_on').fetch(offset, amount)


 




-- 
-
koji matsui

--~--~-~--~~~---~--~~
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: Why can't we use reference properties in queries?

2008-12-15 Thread djidjadji

The collection_name part is just a shortcut for a query you can
construct yourself.

result = ModelWithRef.all().filter('refprop =', obj.key()).fetch(num)

2008/12/15 James thelevybre...@gmail.com:

 The collection_name part of the ReferenceProperty is a really great
 way of threading from another entity back to its reference.

 read more here: 
 http://code.google.com/appengine/docs/datastore/typesandpropertyclasses.html

 On Dec 14, 4:13 pm, Amir  Michail amich...@gmail.com wrote:
 Hi,

 This would be very useful given the limit of 1000 results returned by
 a query.

 Amir
 


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

2008-12-15 Thread djidjadji

A snippet from the manual
==
filter(property_operator, value)

Adds a property condition filter to the query. Only entities with
properties that meet all of the conditions will be returned by the
query.

Arguments:

property_operator
A string containing the property name and a comparison
operator. The name and the operator must be separated by a space, as
in: age  The following comparison operators are supported:  = = =
 (The not-equal (!=) and IN operators are not supported.)
==

You forget the comparison operator in your filter statements.


2008/12/13 paptimus papti...@gmail.com:

 query = models.Ownership.all().filter('user', user),filter('deleted',
 False).order('-created_on').fetch(offset, amount)


--~--~-~--~~~---~--~~
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: model reference problem

2008-12-15 Thread Alexander Kojevnikov

 now if i want to list all the children of a particular parent how do i
 do that?

parent_entity.childmodel_set

You can customise the name of the collectio:

parent = db.ReferenceProperty(ParentModel,
collection_name='children')

... then call:

parent_entity.children

Docs:
http://code.google.com/appengine/docs/datastore/typesandpropertyclasses.html#ReferenceProperty

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



[google-appengine] Django+Appengine vs Appengine

2008-12-15 Thread Bobby

Group, i'm starting work on an AppEngine site and i was going to use
Django (i haven't used it before), i went through the Django docs and
i saw lots of useful features but many exist already on the AppEngine,
such as database models and forms (through
google.appengine.ext.db.djangoforms) - plus the concept of urls and
views seems to be easily reproduced in AppEngine without much code.

In addition to this i'm seeing that the Django admin site has been
replaced by the AppEngine data viewer which isn't as powerful or
customizable right now, so i'm not seeing alot of reasons to use the
Django framework (other than wanting to).

What are the main advantages of using Django on the AppEngine? (i can
see at least two disadvantages in having an additional layer and added
configuration/maintenance). Was Django made compatible with the
AppEngine (through the Appengine Helper for Django) mostly for
allowing users to port their existing Django apps over or does it
actually extend AppEngine with added functionality?

I'm probably missing something, right? Let me know, 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: Is there hope that content-encoding will ever be allowed?

2008-12-15 Thread Bobby

If you're not manipulating the applet with javascript (or vice versa)
then why not just put the applet in an iframe linked from the external
host you mentioned and make it look pretty. It's less than ideal but
one way or another you can get around this.

Bobby

On Dec 9, 4:58 pm, jago java.j...@gmail.com wrote:
 No problem. I also took it for granted that this works - at first at
 least.

 On Dec 9, 9:07 pm, Thomas Johansson prenc...@gmail.com wrote:



  Huh. Never seen this before, I do apologise for the confusion.

  That really should be documented clearly somewhere that isn't specific
  to one of their libraries, as that seems to be a core limitation.

  Again, sorry for the confusion.

  On Dec 9, 8:44 pm, Barry Hunter barrybhun...@googlemail.com wrote:

   2008/12/9 Thomas Johansson prenc...@gmail.com:

On Dec 9, 6:32 pm, jago java.j...@gmail.com wrote:
No you can't. You cannot set the content-encoding in the header in
appengine. Even if you write your own code. Opening sockets is not
allowed just to remind you.

I'm not exactly sure what you are talking about here. You are serving
the jars for the applet using HTTP, correct? AppEngine does not in
*any* way restrict what output you send, other than the size.

   Umm, the documentation tends to contradict that!

  http://code.google.com/appengine/docs/webapp/responseclass.html#Disal...

Content-
Encoding is just another header, and you certainly don't need sockets
for that. Simply write a python handler that sets the content
encoding, opens the file and writes it to the stream (stdout).

If you need to serve something that isn't HTTP, you're barking up the
wrong tree.

   --
   Barry

   -www.nearby.org.uk-www.geograph.org.uk-- Hide quoted text -

 - Show quoted text -

--~--~-~--~~~---~--~~
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] The same here

2008-12-15 Thread Bakyt Niyazov

I'm from Kyrgyzstan and when I'm trying to Verify Your Account by
SMS
I'm getting

An error has occurred while sending. Please try again.

Please help I'm so interested in GAE :(

My number is: +996 545 xx

tried with and w/o +
with and wi/o spaces

--~--~-~--~~~---~--~~
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: The same here

2008-12-15 Thread Dave
Hi there,
I got this error multiple times( when i was entering the number wrongly)
then finally i got through..

Try entering number like this:
my country code is +91 and then 10 digit telephone number
i wrote it like

+91 XXX XXX 

hope this helps!

Regards
Dave

On 12/15/08, Bakyt Niyazov bak...@gmail.com wrote:


 I'm from Kyrgyzstan and when I'm trying to Verify Your Account by
 SMS
 I'm getting

 An error has occurred while sending. Please try again.

 Please help I'm so interested in GAE :(

 My number is: +996 545 xx

 tried with and w/o +
 with and wi/o spaces

 


--~--~-~--~~~---~--~~
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 can we develop apps using SVN?

2008-12-15 Thread James Ashley

Check out assembla.com.  It has both source control hosting (give
mercurial a try...it's a lot more flexible than SVN, the the GUI
options still have their quirks) and project management features
(which is what it sounds like you want).

(Note:  I'm not affiliated with them at all.  Just a happy customer).

On Dec 14, 9:27 am, Stella stella.kovalc...@gmail.com wrote:
 How can I share App-Engine project through SVN? Is there a way to
 divide designer's and programmer's task?
--~--~-~--~~~---~--~~
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: a reusable method for deleting bad ReferenceProperty properties

2008-12-15 Thread niklasr

Thing is the timeout. I manage inconsistencies from this start. Also
check appengine admin which catches bad references.
http://code.google.com/p/appengine-admin/

http://dpaste.com/hold/99361/

class ImagePage(webapp.RequestHandler):
  def get(self):
if users.is_current_user_admin():
if self.request.get('h'):
from datetime import datetime, timedelta
then = datetime.now () - timedelta (hours = int
(self.request.get('h')))
query = db.GqlQuery(SELECT * FROM Image where added  :1
ORDER BY added desc, then)
else:
query = db.GqlQuery(SELECT * FROM Image ORDER BY added
desc limit +self.request.get('limit')+ offset +self.request.get
('offset'))
count = query.count()
self.response.out.write(str(count)+'table border =1')

for image in query:
self.response.out.write('trtda href=/admin/Image/
edit/%s/img src=/gallery/%s' %
  (image.key(), image.key
()))
self.response.out.write('.'+image.thumb_ext+'/a')
try:
self.response.out.write('/tdtda href=/%d/url'
%
  image.reference.key().id
())
self.response.out.write('%s/a' %
  image.reference.url+'br/
'+image.reference.title)
self.response.out.write('/tdtd %s ' %
  image.reference.added)
self.response.out.write('/tdtdad published? %s ' %
 
image.reference.published)
self.response.out.write('/tdtdimage published? %s
' %
  image.published)
self.response.out.write('/tdtda href=/edit?id=
%dEdit ad/a - ' %
  image.reference.key().id
())
self.response.out.write('/td/tr')
except:
self.response.out.write('no reference')
self.response.out.write('/tablebr/')
nextoffset = int(self.request.get('offset')) + int
(self.request.get('limit'))
self.response.out.write('a href=/images.html?
limit='+self.request.get('limit')+'offset='+ str(nextoffset) +
'next/a')



On Dec 14, 10:47 pm, James thelevybre...@gmail.com wrote:
 Most of the time, the errors you get from your model properties will
 happen when you're saving data. For instance, if you try saving a
 string as an IntegerProperty, that will result in an error.

 The one exception (no pun intended) is ReferenceProperty. If you have
 lots of references and you're not completely careful about leaving in
 bad references, it's common to be greeted with an error like
 TemplateSyntaxError: Caught an exception while rendering:
 ReferenceProperty failed to be resolved.

 And this is if there's only one bad reference in the view. D'oh.

 I could write a try/except block to try to access all the reference
 properties and delete them if an exception is raised, but this
 functionality could surely be useful to many other developers if there
 was a more generic method than the one I'd be capable of writing. I
 imagine it would take a list of model types and try to access each
 reference property of each entity in each model, setting the property
 to None if an exception is raised.

 I'll see if I can do this myself, but it would definitely help to have
 some suggestions/snippets to get me started.
--~--~-~--~~~---~--~~
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 is skipped

2008-12-15 Thread paptimus

I get an additional information.

I vacuumed the problem index and rebuilt the same index.
The number of result set before vacuum_index is not same as one of
after that.
Obviously, query is same.

So I think my app get into this situation while rebuilding index.
I hope gae team checks my app's index.
My app id is 'book-case-2' and kind is 'Ownership'.

Thanks.

On 12月16日, 午前1:23, koji matsui papti...@gmail.com wrote:
 Hi, djidjadji, thanks for your comment.

 I tried both query as below:

 query = models.Ownership.all().filter('user', user),filter('deleted',
 False).order('-created_on').fetch(offset, amount)
 query = models.Ownership.all().filter('user =', user),filter('deleted
 =', False).order('-created_on').fetch(offset, amount)

 But the definition of index sdk generates is exactly the same.
 And lack of data in result set is the same.

 So, I think this problem happens when server creates the index.

 Thanks.

 2008/12/15 djidjadji djidja...@gmail.com:





  A snippet from the manual
  ==
  filter(property_operator, value)

 Adds a property condition filter to the query. Only entities with
  properties that meet all of the conditions will be returned by the
  query.

 Arguments:

 property_operator
 A string containing the property name and a comparison
  operator. The name and the operator must be separated by a space, as
  in: age  The following comparison operators are supported:  = = =
  (The not-equal (!=) and IN operators are not supported.)
  ==

  You forget the comparison operator in your filter statements.

  2008/12/13 paptimus papti...@gmail.com:

  query = models.Ownership.all().filter('user', user),filter('deleted',
  False).order('-created_on').fetch(offset, amount)

 --
 -
 koji matsui
--~--~-~--~~~---~--~~
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: non-users need easy url

2008-12-15 Thread thebrianschott

niklasr,

Thank you for sharing your approach. It is very illuminating.

 Andy,

I think I understand a little better and have revised our app but have
not deployed the change yet. The class Group has not been changed, and
we have not yet finalized a way to make the key_name unique by adding
a definition of class Keysorsomething() for that purpose and
enabling a dialog with the user if his/her choice has been taken. But,
I can show you the basic idea by in relation to the original group =
Group() and group.put() section.

Earlier in this thread I had suggested the following sequence of
commands and they were almost correct, but in the last line of the
sequence, instead of key, we needed g_place. With that change and
corresponding changes in two similar places in our maps.py, I think we
have what we want except that we need to add the features which direct
the user to select a unique key_name.

 def post(self):
g_place = self.request.get('place')
group  = Group(key_name=g_place)
group.place = g_place
key = group.put()
self.redirect(/?place=%s % key)

So, yes, I appreciate your further explanation of the differences
between key_name s and id s. I am not sure I have the full picture,
but I am past a major hurdle, for me.

Brian

--~--~-~--~~~---~--~~
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: I appear to be corrupting my datastore

2008-12-15 Thread Marzia Niccolai
Hi,

Thanks for filing the issue.

This is related to storing a floatproperty in the SDK datastore, on Macs the
datastore file may get occasionally corrupted. Currently you will need to
clear the datastore on your local machine to fix this issue.

-Marzia

On Sat, Dec 13, 2008 at 7:52 AM, bowman.jos...@gmail.com 
bowman.jos...@gmail.com wrote:


 I didn't have much luck with switching to a datetimeproperty using
 milliseconds eithers. I also tried handling the value changing in the
 check method directly, since it looked like it was possible there.
 Same results, the datastore gets corrupted. The error I get when I try
 to start the datastore after stopping it is.

 class 'struct.error': unpack requires a string argument of length 8

 def checkScoreValue(self, value):
  valid = False
  while valid == False:
 query = db.GqlQuery('SELECT * FROM Story WHERE score = :1', value)
results = query.fetch(1)
if len(results)  0:
   value = value + 0.001
else:
  valid = True
  return value



 I've filed an issue, #922 -
 http://code.google.com/p/googleappengine/issues/detail?id=922


 On Dec 13, 10:01 am, bowman.jos...@gmail.com
 bowman.jos...@gmail.com wrote:
  I'm trying to make sure a score field I set for articles on my site in
  unique, however, I'm running into an issue where my method is
  appearing to corrupt my datastore. After I input stories, I can't view
  pages, getting a return size too large error, and when I stop and
  start the SDK, it won't restart.
 
  Here's what I'm doing.
 
  I set up a new Score Property.
 
 
  class ScoreProperty(db.FloatProperty):
 
  def checkScoreValue(self, value):
query = db.GqlQuery('SELECT * FROM Story WHERE score = :1', value)
results = query.fetch(1)
if len(results)  0:
  raise db.BadValueError(
  'Property %s must be unique' % self.name)
return value
 
  def __init__(self, verbose_name=None, name=None):
super(ScoreProperty, self).__init__(
  verbose_name, name, required=False,
  validator=self.checkScoreValue)
 
 
 
  Then when I go to add a story, I use this try statement
 
 
  story_added = False
  while story_added == False:
  try:
story.put()
story_added = True
  except db.BadValueError:
story.score = story.score + 0.001
 
 
 
  What should happen is that when a put is attempted, a check is done to
  see if a story with that score exists. If it does exist, add 0.001 and
  try to put again. After adding several stories in batch mode, I can
  using the data view that appears to be working, but strangely. I'll
  see a score of ###.0 and then the next would be something like ###.
  043, so I'm not sure what happened to .001-.0042. Also, after running
  the process the datastore appears to be corrupted as well.
 
  I'm considering swapping to using a DateTimeProperty and keying off of
  the miliseconds to see if that is handled better, but I'm confused as
  to why this current method is creating problems.
 
  One thing that might be an issue is the development is happening on an
  eeepc, which is a single core processor and it's SSD isn't the fast
  read/write storage device.
 


--~--~-~--~~~---~--~~
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: No default application version selected - Help!

2008-12-15 Thread Marzia Niccolai
Hi,

Errors like this will occur when you upload applications too frequently.
The current quota sets application uploads to approximately 100 per day.

-Marzia

On Sat, Dec 13, 2008 at 6:39 PM, Tom sharpbla...@gmail.com wrote:


 I have encountered a strange glitch with GAE. I cant select a default
 version for my application!
 I had one version, and I couldn't select it as the default version.
 Every time I did google threw a unhelpfull 500 - error encountered
 page! And every time I upload my app from my machine, using the
 version set to 2, appcfg.py theows An unexpected error, and aborts,
 and rolls back the update, and displays an equally unhelpful Error
 500 - Server Error (500) A server error has occoured.

 So, I uploaded it using the version set to 3. That allowed me to
 upload, but I couldn't select either one as the default app!

 Help! I cant continue developing because none of my update show at
 x.appspot.com!

 Also on my dashboard there is a Quota exceeded error, which HAS to
 be related to the problem described above. I have not used any of my
 quotas - as I have been the only one using the app, and I have been
 using it for less than a day.

 Regards
 ~Tom

 


--~--~-~--~~~---~--~~
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: Empty Subject - Mail API

2008-12-15 Thread Marzia Niccolai
Hi,

Please file a feature request for this:
http://code.google.com/p/googleappengine/issues/list

Currently, the best work around is to set the subject line to a single space
(' ') if you would prefer not to send a subject.

-Marzia

On Sun, Dec 14, 2008 at 3:05 PM, MajorProgamming sefira...@gmail.comwrote:


 Is there any reason Google does not allow an empty subject when
 sending email via AppEngine? There are many cases where this would
 prove useful.

 [on a side not - even GMail allows sending email w/ empty subjects]
 


--~--~-~--~~~---~--~~
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: Django+Appengine vs Appengine

2008-12-15 Thread Jesaja Everling

Well, Django doesn't really extend App Engine with more functionality,
because you probably could do everything you could do in Django in
webapp and vice versa.

 What are the main advantages of using Django on the AppEngine?

Well, if you ask me that would be support from the Django community
(at least for Django related problems), a lot of reusable apps that
will be easily portable to App Engine (in many cases you only have to
port the model definitions, the rest should work), and independence of
the App Engine environment. And you can make use of many of the
shortcuts that are provided by Django to avoid repititive work.
I think the App Engine devs chose to support Django because it is a
great and very popular framework, and providing it will attract a lot
of people that have experience with Django. In principle, however,
every WSGI-compliant framework could be ported to appengine.
If I'm informed correctly, Guido van Rossum used Django for his
Rietveld project.

If you want to get as much Django-Appengine integration as possible,
try the app-engine-patch:
http://code.google.com/p/app-engine-patch/

It even makes a lot of Django's generic views available in App Engine.

Best Regards,

Jesaja Everling


On Mon, Dec 15, 2008 at 8:58 AM, Bobby bobbysoa...@gmail.com wrote:

 Group, i'm starting work on an AppEngine site and i was going to use
 Django (i haven't used it before), i went through the Django docs and
 i saw lots of useful features but many exist already on the AppEngine,
 such as database models and forms (through
 google.appengine.ext.db.djangoforms) - plus the concept of urls and
 views seems to be easily reproduced in AppEngine without much code.

 In addition to this i'm seeing that the Django admin site has been
 replaced by the AppEngine data viewer which isn't as powerful or
 customizable right now, so i'm not seeing alot of reasons to use the
 Django framework (other than wanting to).

 What are the main advantages of using Django on the AppEngine? (i can
 see at least two disadvantages in having an additional layer and added
 configuration/maintenance). Was Django made compatible with the
 AppEngine (through the Appengine Helper for Django) mostly for
 allowing users to port their existing Django apps over or does it
 actually extend AppEngine with added functionality?

 I'm probably missing something, right? Let me know, 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: I appear to be corrupting my datastore

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

This is actually happening on Linux, not sure if that matters or not.

Clearing the datastore is my only solution to getting it back up on
the SDK currently, but once I run the routine again, it's corrupted
again. I did try converting the entire property to a
db.DateTimeProperty and adding milliseconds, and had the same
corruption issues.

On Dec 15, 2:07 pm, Marzia Niccolai ma...@google.com wrote:
 Hi,

 Thanks for filing the issue.

 This is related to storing a floatproperty in the SDK datastore, on Macs the
 datastore file may get occasionally corrupted. Currently you will need to
 clear the datastore on your local machine to fix this issue.

 -Marzia

 On Sat, Dec 13, 2008 at 7:52 AM, bowman.jos...@gmail.com 

 bowman.jos...@gmail.com wrote:

  I didn't have much luck with switching to a datetimeproperty using
  milliseconds eithers. I also tried handling the value changing in the
  check method directly, since it looked like it was possible there.
  Same results, the datastore gets corrupted. The error I get when I try
  to start the datastore after stopping it is.

  class 'struct.error': unpack requires a string argument of length 8

  def checkScoreValue(self, value):
   valid = False
   while valid == False:
  query = db.GqlQuery('SELECT * FROM Story WHERE score = :1', value)
 results = query.fetch(1)
 if len(results)  0:
value = value + 0.001
 else:
   valid = True
   return value

  I've filed an issue, #922 -
 http://code.google.com/p/googleappengine/issues/detail?id=922

  On Dec 13, 10:01 am, bowman.jos...@gmail.com
  bowman.jos...@gmail.com wrote:
   I'm trying to make sure a score field I set for articles on my site in
   unique, however, I'm running into an issue where my method is
   appearing to corrupt my datastore. After I input stories, I can't view
   pages, getting a return size too large error, and when I stop and
   start the SDK, it won't restart.

   Here's what I'm doing.

   I set up a new Score Property.

  
   class ScoreProperty(db.FloatProperty):

   def checkScoreValue(self, value):
 query = db.GqlQuery('SELECT * FROM Story WHERE score = :1', value)
 results = query.fetch(1)
 if len(results)  0:
   raise db.BadValueError(
   'Property %s must be unique' % self.name)
 return value

   def __init__(self, verbose_name=None, name=None):
 super(ScoreProperty, self).__init__(
   verbose_name, name, required=False,
   validator=self.checkScoreValue)

  

   Then when I go to add a story, I use this try statement

  
   story_added = False
   while story_added == False:
   try:
 story.put()
 story_added = True
   except db.BadValueError:
 story.score = story.score + 0.001

  

   What should happen is that when a put is attempted, a check is done to
   see if a story with that score exists. If it does exist, add 0.001 and
   try to put again. After adding several stories in batch mode, I can
   using the data view that appears to be working, but strangely. I'll
   see a score of ###.0 and then the next would be something like ###.
   043, so I'm not sure what happened to .001-.0042. Also, after running
   the process the datastore appears to be corrupted as well.

   I'm considering swapping to using a DateTimeProperty and keying off of
   the miliseconds to see if that is handled better, but I'm confused as
   to why this current method is creating problems.

   One thing that might be an issue is the development is happening on an
   eeepc, which is a single core processor and it's SSD isn't the fast
   read/write storage device.
--~--~-~--~~~---~--~~
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: I appear to be corrupting my datastore

2008-12-15 Thread Marzia Niccolai
Hi,

I just assumed it was Mac because it's an issue we've seen with Macs that
have 2.5.0 installed, and I'm assuming this is your Python installation?
Generally, float values in the datastore just don't work with Python 2.5.0.
Support for buffer objects in struct.unpack was not added until version
54695 (Apr 2007), this is the underlying cause of the error message.

-Marzia

On Mon, Dec 15, 2008 at 11:54 AM, bowman.jos...@gmail.com 
bowman.jos...@gmail.com wrote:


 This is actually happening on Linux, not sure if that matters or not.

 Clearing the datastore is my only solution to getting it back up on
 the SDK currently, but once I run the routine again, it's corrupted
 again. I did try converting the entire property to a
 db.DateTimeProperty and adding milliseconds, and had the same
 corruption issues.

 On Dec 15, 2:07 pm, Marzia Niccolai ma...@google.com wrote:
  Hi,
 
  Thanks for filing the issue.
 
  This is related to storing a floatproperty in the SDK datastore, on Macs
 the
  datastore file may get occasionally corrupted. Currently you will need to
  clear the datastore on your local machine to fix this issue.
 
  -Marzia
 
  On Sat, Dec 13, 2008 at 7:52 AM, bowman.jos...@gmail.com 
 
  bowman.jos...@gmail.com wrote:
 
   I didn't have much luck with switching to a datetimeproperty using
   milliseconds eithers. I also tried handling the value changing in the
   check method directly, since it looked like it was possible there.
   Same results, the datastore gets corrupted. The error I get when I try
   to start the datastore after stopping it is.
 
   class 'struct.error': unpack requires a string argument of length 8
 
   def checkScoreValue(self, value):
valid = False
while valid == False:
   query = db.GqlQuery('SELECT * FROM Story WHERE score = :1', value)
  results = query.fetch(1)
  if len(results)  0:
 value = value + 0.001
  else:
valid = True
return value
 
   I've filed an issue, #922 -
  http://code.google.com/p/googleappengine/issues/detail?id=922
 
   On Dec 13, 10:01 am, bowman.jos...@gmail.com
   bowman.jos...@gmail.com wrote:
I'm trying to make sure a score field I set for articles on my site
 in
unique, however, I'm running into an issue where my method is
appearing to corrupt my datastore. After I input stories, I can't
 view
pages, getting a return size too large error, and when I stop and
start the SDK, it won't restart.
 
Here's what I'm doing.
 
I set up a new Score Property.
 
  
 
class ScoreProperty(db.FloatProperty):
 
def checkScoreValue(self, value):
  query = db.GqlQuery('SELECT * FROM Story WHERE score = :1', value)
  results = query.fetch(1)
  if len(results)  0:
raise db.BadValueError(
'Property %s must be unique' % self.name)
  return value
 
def __init__(self, verbose_name=None, name=None):
  super(ScoreProperty, self).__init__(
verbose_name, name, required=False,
validator=self.checkScoreValue)
 
  
 
 
Then when I go to add a story, I use this try statement
 
  
 
story_added = False
while story_added == False:
try:
  story.put()
  story_added = True
except db.BadValueError:
  story.score = story.score + 0.001
 
  
 
 
What should happen is that when a put is attempted, a check is done
 to
see if a story with that score exists. If it does exist, add 0.001
 and
try to put again. After adding several stories in batch mode, I can
using the data view that appears to be working, but strangely. I'll
see a score of ###.0 and then the next would be something like ###.
043, so I'm not sure what happened to .001-.0042. Also, after running
the process the datastore appears to be corrupted as well.
 
I'm considering swapping to using a DateTimeProperty and keying off
 of
the miliseconds to see if that is handled better, but I'm confused as
to why this current method is creating problems.
 
One thing that might be an issue is the development is happening on
 an
eeepc, which is a single core processor and it's SSD isn't the fast
read/write storage device.
 


--~--~-~--~~~---~--~~
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: Django+Appengine vs Appengine

2008-12-15 Thread Bobby

Ah, good point about being able to make use of existing Django apps.
Thanks.

Bobby

On Dec 15, 2:46 pm, Jesaja Everling jeverl...@gmail.com wrote:
 Well, Django doesn't really extend App Engine with more functionality,
 because you probably could do everything you could do in Django in
 webapp and vice versa.

  What are the main advantages of using Django on the AppEngine?

 Well, if you ask me that would be support from the Django community
 (at least for Django related problems), a lot of reusable apps that
 will be easily portable to App Engine (in many cases you only have to
 port the model definitions, the rest should work), and independence of
 the App Engine environment. And you can make use of many of the
 shortcuts that are provided by Django to avoid repititive work.
 I think the App Engine devs chose to support Django because it is a
 great and very popular framework, and providing it will attract a lot
 of people that have experience with Django. In principle, however,
 every WSGI-compliant framework could be ported to appengine.
 If I'm informed correctly, Guido van Rossum used Django for his
 Rietveld project.

 If you want to get as much Django-Appengine integration as possible,
 try the app-engine-patch:http://code.google.com/p/app-engine-patch/

 It even makes a lot of Django's generic views available in App Engine.

 Best Regards,

 Jesaja Everling



 On Mon, Dec 15, 2008 at 8:58 AM, Bobby bobbysoa...@gmail.com wrote:

  Group, i'm starting work on an AppEngine site and i was going to use
  Django (i haven't used it before), i went through the Django docs and
  i saw lots of useful features but many exist already on the AppEngine,
  such as database models and forms (through
  google.appengine.ext.db.djangoforms) - plus the concept of urls and
  views seems to be easily reproduced in AppEngine without much code.

  In addition to this i'm seeing that the Django admin site has been
  replaced by the AppEngine data viewer which isn't as powerful or
  customizable right now, so i'm not seeing alot of reasons to use the
  Django framework (other than wanting to).

  What are the main advantages of using Django on the AppEngine? (i can
  see at least two disadvantages in having an additional layer and added
  configuration/maintenance). Was Django made compatible with the
  AppEngine (through the Appengine Helper for Django) mostly for
  allowing users to port their existing Django apps over or does it
  actually extend AppEngine with added functionality?

  I'm probably missing something, right? Let me know, thanks.- Hide quoted 
  text -

 - Show quoted text -
--~--~-~--~~~---~--~~
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: I appear to be corrupting my datastore

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

Ok great. I'll have to check on the python version, it's whatever
xandros makes available (I haven't gotten rid of the default OS on my
eeepc because I'm lazy). If worse comes to worse I'll try compiling
the latest python by hand and see if that works. I should have this
done by the weekend. I'll post a comment to the ticket if this
resolves the issue. Thanks for the quick knowledgeable response as
always.

On Dec 15, 3:06 pm, Marzia Niccolai ma...@google.com wrote:
 Hi,

 I just assumed it was Mac because it's an issue we've seen with Macs that
 have 2.5.0 installed, and I'm assuming this is your Python installation?
 Generally, float values in the datastore just don't work with Python 2.5.0.
 Support for buffer objects in struct.unpack was not added until version
 54695 (Apr 2007), this is the underlying cause of the error message.

 -Marzia

 On Mon, Dec 15, 2008 at 11:54 AM, bowman.jos...@gmail.com 

 bowman.jos...@gmail.com wrote:

  This is actually happening on Linux, not sure if that matters or not.

  Clearing the datastore is my only solution to getting it back up on
  the SDK currently, but once I run the routine again, it's corrupted
  again. I did try converting the entire property to a
  db.DateTimeProperty and adding milliseconds, and had the same
  corruption issues.

  On Dec 15, 2:07 pm, Marzia Niccolai ma...@google.com wrote:
   Hi,

   Thanks for filing the issue.

   This is related to storing a floatproperty in the SDK datastore, on Macs
  the
   datastore file may get occasionally corrupted. Currently you will need to
   clear the datastore on your local machine to fix this issue.

   -Marzia

   On Sat, Dec 13, 2008 at 7:52 AM, bowman.jos...@gmail.com 

   bowman.jos...@gmail.com wrote:

I didn't have much luck with switching to a datetimeproperty using
milliseconds eithers. I also tried handling the value changing in the
check method directly, since it looked like it was possible there.
Same results, the datastore gets corrupted. The error I get when I try
to start the datastore after stopping it is.

class 'struct.error': unpack requires a string argument of length 8

def checkScoreValue(self, value):
 valid = False
 while valid == False:
query = db.GqlQuery('SELECT * FROM Story WHERE score = :1', value)
   results = query.fetch(1)
   if len(results)  0:
  value = value + 0.001
   else:
 valid = True
 return value

I've filed an issue, #922 -
   http://code.google.com/p/googleappengine/issues/detail?id=922

On Dec 13, 10:01 am, bowman.jos...@gmail.com
bowman.jos...@gmail.com wrote:
 I'm trying to make sure a score field I set for articles on my site
  in
 unique, however, I'm running into an issue where my method is
 appearing to corrupt my datastore. After I input stories, I can't
  view
 pages, getting a return size too large error, and when I stop and
 start the SDK, it won't restart.

 Here's what I'm doing.

 I set up a new Score Property.

  
 class ScoreProperty(db.FloatProperty):

 def checkScoreValue(self, value):
   query = db.GqlQuery('SELECT * FROM Story WHERE score = :1', value)
   results = query.fetch(1)
   if len(results)  0:
 raise db.BadValueError(
 'Property %s must be unique' % self.name)
   return value

 def __init__(self, verbose_name=None, name=None):
   super(ScoreProperty, self).__init__(
 verbose_name, name, required=False,
 validator=self.checkScoreValue)

  

 Then when I go to add a story, I use this try statement

  
 story_added = False
 while story_added == False:
 try:
   story.put()
   story_added = True
 except db.BadValueError:
   story.score = story.score + 0.001

  

 What should happen is that when a put is attempted, a check is done
  to
 see if a story with that score exists. If it does exist, add 0.001
  and
 try to put again. After adding several stories in batch mode, I can
 using the data view that appears to be working, but strangely. I'll
 see a score of ###.0 and then the next would be something like ###.
 043, so I'm not sure what happened to .001-.0042. Also, after running
 the process the datastore appears to be corrupted as well.

 I'm considering swapping to using a DateTimeProperty and keying off
  of
 the miliseconds to see if that is handled better, but I'm confused as
 to why this current method is creating problems.

 One thing that might be an issue is the development is happening on
  an
 eeepc, which is a single core processor 

[google-appengine] Re: WSGIApplication last byte downloaded

2008-12-15 Thread Marzia Niccolai
Hi,

Currently there is no way to verify this only with App Engine.

I imagine that you could build a solution that would use some kind of client
software + App Engine to check the hash of the file on the client side and
verify it against the known value stored on App Engine.

-Marzia

On Sun, Dec 14, 2008 at 10:05 AM, Robert S robspych...@gmail.com wrote:


 Hi GAE users,

 Is there a way to test if the last byte of the blob has been
 transferred to the client?

self.response.out.write(model.blob)

 This would be useful for digital asset order fulfillment applications
 which shouldn't necessarily charge you for a download until the app
 can safely assume that the download is complete.

 thanks,

 r.S.


 


--~--~-~--~~~---~--~~
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: Django+Appengine vs Appengine

2008-12-15 Thread Bobby

One note on portability, for example for retrieving all objects in the
datastore, sorted, in Django one could do:
Poll.objects.all().order_by(...)
Whereas in AppEngine it complains that order_by isn't defined, and i
have to use the AppEngine's version:
Poll.objects.all().order(...)

Also, when calling the following shortcut:
get_object_or_404(MyDbModel, pk=my_id)
It complains that pk is an unexpected argument.

This is using the AppEngine helper (not the patch you linked to). I
thought the AppEngine helper would make sure that the Django model
methods would delegate to the AppEngine's version transparently but
some seem to be missing - why is this?

Bobby

On Dec 15, 3:31 pm, Bobby bobbysoa...@gmail.com wrote:
 Ah, good point about being able to make use of existing Django apps.
 Thanks.

 Bobby

 On Dec 15, 2:46 pm, Jesaja Everling jeverl...@gmail.com wrote:



  Well, Django doesn't really extend App Engine with more functionality,
  because you probably could do everything you could do in Django in
  webapp and vice versa.

   What are the main advantages of using Django on the AppEngine?

  Well, if you ask me that would be support from the Django community
  (at least for Django related problems), a lot of reusable apps that
  will be easily portable to App Engine (in many cases you only have to
  port the model definitions, the rest should work), and independence of
  the App Engine environment. And you can make use of many of the
  shortcuts that are provided by Django to avoid repititive work.
  I think the App Engine devs chose to support Django because it is a
  great and very popular framework, and providing it will attract a lot
  of people that have experience with Django. In principle, however,
  every WSGI-compliant framework could be ported to appengine.
  If I'm informed correctly, Guido van Rossum used Django for his
  Rietveld project.

  If you want to get as much Django-Appengine integration as possible,
  try the app-engine-patch:http://code.google.com/p/app-engine-patch/

  It even makes a lot of Django's generic views available in App Engine.

  Best Regards,

  Jesaja Everling

  On Mon, Dec 15, 2008 at 8:58 AM, Bobby bobbysoa...@gmail.com wrote:

   Group, i'm starting work on an AppEngine site and i was going to use
   Django (i haven't used it before), i went through the Django docs and
   i saw lots of useful features but many exist already on the AppEngine,
   such as database models and forms (through
   google.appengine.ext.db.djangoforms) - plus the concept of urls and
   views seems to be easily reproduced in AppEngine without much code.

   In addition to this i'm seeing that the Django admin site has been
   replaced by the AppEngine data viewer which isn't as powerful or
   customizable right now, so i'm not seeing alot of reasons to use the
   Django framework (other than wanting to).

   What are the main advantages of using Django on the AppEngine? (i can
   see at least two disadvantages in having an additional layer and added
   configuration/maintenance). Was Django made compatible with the
   AppEngine (through the Appengine Helper for Django) mostly for
   allowing users to port their existing Django apps over or does it
   actually extend AppEngine with added functionality?

   I'm probably missing something, right? Let me know, thanks.- Hide quoted 
   text -

  - Show quoted text -- Hide quoted text -

 - Show quoted text -
--~--~-~--~~~---~--~~
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: Difficulty Serving Static Image with static_files handler

2008-12-15 Thread Marzia Niccolai
Hi Dylan,

H, this is confusing because it works perfectly for me.  I made a simple
application:

static
 - photos
  - folder
- image.jpg
  - folder2
- image.jpg [different image]

With this in my app.yaml:
- url: /photos/(.*)/(.*\.(gif|jpg))
  static_files: static/photos/\1/\2
  upload: static/photos/(.*)/(.*\.(gif|jpg))

And it works perfectly.

The only thing I can think of that may not make this work is if you have
another handler in your app.yaml that also matches those files and is
defined before this one that is causing this issue.

So this could 404 if your app.yaml looks like this:
-app.yaml-
- url: /.*
  script: main.py

- url: /photos/(.*)/(.*\.(gif|jpg))
  static_files: static/photos/\1/\2
  upload: static/photos/(.*)/(.*\.(gif|jpg))
-end-

Because the first handler matches all URLs.

Hope this helps, if not, perhaps attach your entire app.yaml file?

-Marzia

On Sun, Dec 14, 2008 at 12:11 AM, Dylan Lorimer write2dy...@gmail.comwrote:


 Hi,

 In my app.yaml I have the following:

 - url: /photos/(.*)/(.*\.(gif|png|jpg))
  static_files: static/photos/\1/\2
  upload: static/photos/(.*)/(.*\.(gif|png|jpg))

 My application has images that I've uploaded per the following
 directory structure:

 application root
  - static
  - photos
  -folder_1/image_1.jpg
  -folder_1/image_2.jpg

  -folder_2/image_3.jpg

 etc etc

 For the life of me I can't seem to serve these images successfully.
 Any URL hit to: www.myapp.com/photos/photo_folder_name/image_name.jpg
 results in a 404 not found.

 I'm certain this is an issue with my app.yaml static handler but can't
 figure it out. Any help is SUPER appreciated. It's possible that they
 are not being uploaded due to an error in the upload directive, but I
 don't think that's the case.

 Thanks much.
 


--~--~-~--~~~---~--~~
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: No log warning for heavy datastore operations, dashboard marks are yellow and red

2008-12-15 Thread Marzia Niccolai
Hi,

Answers inline

On Sun, Dec 14, 2008 at 4:12 PM, djidjadji djidja...@gmail.com wrote:


 I have read the posts about log warnings and the FAQ at
 http://knol.google.com/k/marce/app-engine-community-faqs/vkzeph4si12v/1#

 - From the FAQ
 A: The mcycles number included in log entries includes only the CPU
 consumed in the Python runtime and the datastore. The number in the
 dashboard includes the mcycles used in both your code and API code.
 This is why the dashboard number is usually higher.
 --


I've updated this FAQ.  This information isn't correct (even though I think
I may have said it, *sigh*).  The most up-to-date information on high CPU
warnings can be found at:
http://code.google.com/appengine/kb/general.html#highcpu

Please consider this the canonical source of information on high CPU
warnings.



 if I understand the FAQ can I write a python request handler that does
 a lot of calculations and won't get a log warning?


This is maybe not true, depending on what you mean.  The logs containing two
different 'warning' indicators.  The first is the (possibly) colored CPU
consumption numbers on first log line.  The second is something that says:
This request used a high amount of CPU, and was roughly X times over
the average
CPU request limit...

These two indicators are calculated differently.  The CPU listed on the
first line is _total_ CPU used, runtime, datastore and other APIs.  Since
the runtime and datastore CPU are generally much higher than any other APIs,
these numbers are the ones that weigh the most on this measurement.

The CPU that actually generates a logged warning message is _runtime only_.
If you do a lot of calculations in your runtime (sorting in memory, complex
math calculations, large module loads), you will get the log warning in your
dashboard.



 The calculation has no datastore get() or put() operations and very
 few python runtime calls like zip(), map(), list comprehentions.

 I tested extensively the other side: heavy datastore request handlers
 and noted the average CPU a request costs.
 The numbers are taken from the dashboard. And about 100 to 400
 requests per value of N where used to determine the average.

 My test Model contained an IntegerProperty and a StringProperty. The
 number was random [0..1] and the strings had 10 random lowercase
 characters. I started with a datastore that contained more then 1000
 of these objects.

 ===
 The first experiment was: How much CPU does it cost to fetch N objects?

 Every request reads N objects starting at a certain random number.
 query.filter('num =', startNum).fetch(N)
 There is a wait of 1 sec in between requests.

 here are the measurements
 N=0 CPU=7  Mcycle
 N=1 CPU=108
 N=5 CPU=264
 N=10   CPU=464
 N=15   CPU=663
 N=20   CPU=863
 N=25   CPU=1059
 N=30   CPU=1260

 I have made a graph of these figures:   http://tinyurl.com/6hkc6q   (a
 very long google chart URL)

 I also did the experiment to print the number and string of these N
 objects with a Django template and with a Python for-loop. The Python
 for-loop costs 1Mcycle extra for every value of N, the Django template
 costs 6 Mcycle extra for N=30 and 3 Mcycle extra for N=5.

 ===
 The second experiment was: How much CPU does it cost to create or
 delete N objects?

 A request creates N objects starting at a certain random number, n,
 n+1,n+2
 Puts them in a list and stores them with db.put(objlist)
 The delete request reads N objects starting at a certain random
 number.query.filter('num =', startNum).fetch(N)
 Then calls db.delete(objlist).
 There is a wait of 1 sec in between requests.

 here are the measurements
 N=1 createCPU=799   deleteCPU=699  Mcycle
 N=2 createCPU=1589 deleteCPU=1306
 N=3 createCPU=2377 deleteCPU=1957
 N=4 createCPU=3150 deleteCPU=2585
 N=5 createCPU=3956 deleteCPU=3216
 N=10   createCPU=7900 deleteCPU=6317

 A graph of these figures:   http://tinyurl.com/6s3hq7


 Only 2 of all these requests, a couple of 1000 in total, did result in
 a log warning that I use a lot of CPU,
 one for a create(N=3)[4239Mcycle] and one for a create(N=4)[5046Mcycle]
 Why not the 100 create requests for N=10, and they where 1 sec apart.
 ( 1 sec wait after receipt of a result ).
 The log warnings have a threshold of 1000Mcycle, and if I remember
 correct I have read, you are allowed 2 per minute before the app is
 blocked temporarily.
 During the testing of this experiment I had a dashboard line telling
 me a series of requests took 11000 MCycle on average, NO log warning.

 Why don't these (2000Mcycle) datastore requests give a lot of log
 warnings?
 The time spend in my code is around 7 Mcycle (N=0).


The CPU you are seeing is most likely datastore CPU.  This CPU won't result
in warning lines in your logs.  Again, only runtime CPU usage will cause
these warnings to appear, and the 2/minute limit applies only to runtime CPU
and not to 

[google-appengine] Re: The same here

2008-12-15 Thread Alexander Kojevnikov

Fill out the SMS issues form:
http://appengine.google.com/waitlist/sms_issues

There's a community FAQ that covers this and other common issues:
http://knol.google.com/k/marce/app-engine-community-faqs/vkzeph4si12v/1#

--
www.muspy.com

On Dec 16, 4:34 am, Dave confused.develo...@gmail.com wrote:
 Hi there,
 I got this error multiple times( when i was entering the number wrongly)
 then finally i got through..

 Try entering number like this:
 my country code is +91 and then 10 digit telephone number
 i wrote it like

 +91 XXX XXX 

 hope this helps!

 Regards
 Dave

 On 12/15/08, Bakyt Niyazov bak...@gmail.com wrote:



  I'm from Kyrgyzstan and when I'm trying to Verify Your Account by
  SMS
  I'm getting

  An error has occurred while sending. Please try again.

  Please help I'm so interested in GAE :(

  My number is: +996 545 xx

  tried with and w/o +
  with and wi/o spaces
--~--~-~--~~~---~--~~
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: Empty Subject - Mail API

2008-12-15 Thread MajorProgamming

Did that:

http://code.google.com/p/googleappengine/issues/detail?id=925

Thanks

On Dec 15, 2:32 pm, Marzia Niccolai ma...@google.com wrote:
 Hi,

 Please file a feature request for 
 this:http://code.google.com/p/googleappengine/issues/list

 Currently, the best work around is to set the subject line to a single space
 (' ') if you would prefer not to send a subject.

 -Marzia

 On Sun, Dec 14, 2008 at 3:05 PM, MajorProgamming sefira...@gmail.comwrote:





  Is there any reason Google does not allow an empty subject when
  sending email via AppEngine? There are many cases where this would
  prove useful.

  [on a side not - even GMail allows sending email w/ empty subjects]- Hide 
  quoted text -

 - Show quoted text -
--~--~-~--~~~---~--~~
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: Django+Appengine vs Appengine

2008-12-15 Thread Alexander Kojevnikov

The problem with built-in djangoforms and templates is that they are
from Django 0.96. Django 1.0 has a lot of new useful functionality, it
really worth the trouble installing it with your app.

Another advantage of Django is that it allows to implement custom user
authentication, this is especially easy with app-engine-patch. This
was actually the reason I migrated my project from webapp to Django.

Other than that, webapp is a very lightweight yet flexible framework.
If it works for your project, by all means - use it!

--
www.muspy.com


On Dec 15, 6:58 pm, Bobby bobbysoa...@gmail.com wrote:
 Group, i'm starting work on an AppEngine site and i was going to use
 Django (i haven't used it before), i went through the Django docs and
 i saw lots of useful features but many exist already on the AppEngine,
 such as database models and forms (through
 google.appengine.ext.db.djangoforms) - plus the concept of urls and
 views seems to be easily reproduced in AppEngine without much code.

 In addition to this i'm seeing that the Django admin site has been
 replaced by the AppEngine data viewer which isn't as powerful or
 customizable right now, so i'm not seeing alot of reasons to use the
 Django framework (other than wanting to).

 What are the main advantages of using Django on the AppEngine? (i can
 see at least two disadvantages in having an additional layer and added
 configuration/maintenance). Was Django made compatible with the
 AppEngine (through the Appengine Helper for Django) mostly for
 allowing users to port their existing Django apps over or does it
 actually extend AppEngine with added functionality?

 I'm probably missing something, right? Let me know, 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: Django+Appengine vs Appengine

2008-12-15 Thread Alexander Kojevnikov

 This is using the AppEngine helper (not the patch you linked to). I
 thought the AppEngine helper would make sure that the Django model
 methods would delegate to the AppEngine's version transparently but
 some seem to be missing - why is this?

app-engine-patch does not try to replace appengine models. You end up
with the same data access code as with the plain vanilla appengine.
From their homepage:

  Conceptual difference [with appengine-helper]: We don't try to
emulate Django's Model because that's impossible, anyway.

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



[google-appengine] Re: Not able to start dev_appserver

2008-12-15 Thread Sambi

Thanks,

It is working fine after re-installing PIL

- Sambi

On Dec 15, 4:51 am, djidjadji djidja...@gmail.com wrote:
 It looks like your problem is with the PIL installation, not with the
 google_appengine dev_server.

 2008/12/15 Sambi ad...@tollymdb.com:
 [snip]



   File C:\Program Files\Google\google_appengine\google\appengine\api
  \images\ima
  ges_stub.py, line 45, in __init__
     Image.init()
   File C:\Python25\lib\site-packages\PIL\Image.py, line 345, in init
     __import__(f, globals(), locals(), [])
   File C:\Python25\lib\site-packages\PIL\TiffImagePlugin.py, line
  440, in mod
  ule
     class TiffImageFile(ImageFile.ImageFile):
  AttributeError: 'module' object has no attribute 'ImageFile'
--~--~-~--~~~---~--~~
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 updates on deleting all entities in the production datastore?

2008-12-15 Thread Jyoti Shete-Javadekar
Hi,
I want to delete all my data models in production environment and upload new
set of entities. I have gone through previous threads regarding this
requirement. So far the solution seems to be selecting bunch of entities and
then deleting them through script or through data viewer. I tried both the
ways but they are not efficient. I am able to delete maximum 100-200 rows at
a time.

Is there any update on any appengine utility to delete all models in the
production datastore at once?

thanks,
Jyoti

--~--~-~--~~~---~--~~
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 submit form from static index.html

2008-12-15 Thread rakf1

I have a app running with static files, i have a form in the
index.html which has to be emailed back to me onsubmit. Is there a way
to do this? I have no experience with python, can this be done like
with php? I was able to find some documentation on sendmail:
http://code.google.com/appengine/docs/mail/sendingmail.html, but how
do I do this from static index.html.

my app.yaml:

application: xxx
version: 1
runtime: python
api_version: 1

handlers:
- url: (.*)/
  static_files: static\1/index.html
  upload: static/index.html

- url: /
  static_dir: static

--~--~-~--~~~---~--~~
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] Googe App Engine and Friend Connect...

2008-12-15 Thread bvelasquez

I added Google's Friend Connect to my GAE application.  Now, there are
two sign in steps on my site.  One to authenticate using GAE users and
the other for Friend Connect.  This is not desirable and I was
wondering if anyone knew of the method for integrating the two so
there is only one sign-in.  I should be able to pass the Google
Authentication through Friend Connect to the GAE application.
--~--~-~--~~~---~--~~
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 is skipped

2008-12-15 Thread paptimus

Hi, Marzia. Thank you for your reply.

It is missing.
For example, I run this query:

query = models.Ownership.all().filter('user =',
papti...@gmail.com),filter('deleted =',False).order('-
created_on').fetch(0, 20)

These lists are my expecting/getting result.
The getting result contains no 'NG' data but folowing 3 data.

expecting:
2008-12-12 10:25:23.397434
2008-12-09 18:04:23.439058
2008-12-03 15:22:46.754546
2008-12-03 15:22:45.251281
2008-12-03 15:22:42.594933
2008-12-03 15:22:41.149333
2008-12-03 15:22:39.559995
2008-12-03 15:22:38.116000
2008-12-03 15:22:36.511006
2008-12-03 15:22:35.117080
2008-12-03 15:22:33.679363
2008-12-03 15:22:32.119234
2008-12-03 15:22:30.461840
2008-12-03 15:22:28.936849
2008-12-03 15:22:27.518304
2008-12-03 15:22:26.039718
2008-12-03 15:22:24.665877NG
2008-12-03 15:22:23.188243
2008-12-03 15:22:21.681791NG
2008-12-03 15:22:20.245579NG

getting:
2008-12-12 10:25:23.397434
2008-12-09 18:04:23.439058
2008-12-03 15:22:46.754546
2008-12-03 15:22:45.251281
2008-12-03 15:22:42.594933
2008-12-03 15:22:41.149333
2008-12-03 15:22:39.559995
2008-12-03 15:22:38.116000
2008-12-03 15:22:36.511006
2008-12-03 15:22:35.117080
2008-12-03 15:22:33.679363
2008-12-03 15:22:32.119234
2008-12-03 15:22:30.461840
2008-12-03 15:22:28.936849
2008-12-03 15:22:27.518304
2008-12-03 15:22:26.039718
2008-12-03 15:22:23.188243
2008-12-03 15:22:18.783426
2008-12-03 15:22:17.303290
2008-12-03 15:22:13.102364

Thanks.

On 12月16日, 午前5:18, Marzia Niccolai ma...@google.com wrote:
 Hi,

 Thanks for the report, but I'm not sure I understand how exactly your query
 is having an issue.

 Can you elaborate on this statement: The result set is ordered by
 '-created_on', but it is not sequential.  What data are you getting? What
 data are you expecting? Is it misordered or missing?

 Also, have you tried adding this index to your index.yaml and uploading it
 with your application:

 - kind: Ownership
  properties:
  - name: user
  - name: deleted
  - name: created_on
direction: desc

 Thanks,
 Marzia

 On Mon, Dec 15, 2008 at 11:05 AM, paptimus papti...@gmail.com wrote:

  I get an additional information.

  I vacuumed the problem index and rebuilt the same index.
  The number of result set before vacuum_index is not same as one of
  after that.
  Obviously, query is same.

  So I think my app get into this situation while rebuilding index.
  I hope gae team checks my app's index.
  My app id is 'book-case-2' and kind is 'Ownership'.

  Thanks.

  On 12月16日, 午前1:23, koji matsui papti...@gmail.com wrote:
   Hi, djidjadji, thanks for your comment.

   I tried both query as below:

   query = models.Ownership.all().filter('user', user),filter('deleted',
   False).order('-created_on').fetch(offset, amount)
   query = models.Ownership.all().filter('user =', user),filter('deleted
   =', False).order('-created_on').fetch(offset, amount)

   But the definition of index sdk generates is exactly the same.
   And lack of data in result set is the same.

   So, I think this problem happens when server creates the index.

   Thanks.

   2008/12/15 djidjadji djidja...@gmail.com:

A snippet from the manual
==
filter(property_operator, value)

   Adds a property condition filter to the query. Only entities with
properties that meet all of the conditions will be returned by the
query.

   Arguments:

   property_operator
   A string containing the property name and a comparison
operator. The name and the operator must be separated by a space, as
in: age  The following comparison operators are supported:  = = =
(The not-equal (!=) and IN operators are not supported.)
==

You forget the comparison operator in your filter statements.

2008/12/13 paptimus papti...@gmail.com:

query = models.Ownership.all().filter('user', user),filter('deleted',
False).order('-created_on').fetch(offset, amount)

   --
   -
   koji matsui


--~--~-~--~~~---~--~~
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] Unable to import non-root modules; works fine in dev_appserver

2008-12-15 Thread boson

This has been driving me nuts for the better part of 3 days.
I'm trying to organize my Python code, but when I move .py files out
of the app's root directory, the production servers seem to be unable
to import them.  Yet it works perfectly fine on my local
dev_appserver.

Say I create a directory called code in the app root.  I put a file
mymodule.py in there.  (There is also a blank __init__.py in code
to make sure Python recognizes code as a module -- not sure if this
is necessary or not, but it's there).
Now I can import App Engine modules fine.
And I can import any modules that are in the app's root directory.
But as soon as I try import code.mymodule, the Production Server
freaks out:

type 'exceptions.ImportError': No module named mymodule
Traceback (most recent call last):
  File /base/data/home/apps/rescue2012/1.330013328833611377/
handler.py, line 4, in module
import code.mymodule

This works just fine on my local development server.  It finds
mymodule.py in code, creates the .pyc, and uses it perfectly.

Am I doing something wrong, or is this a bug in GAE?  I know people
are including libraries (newer versions of Django, etc.) in their
apps, so I'm not the only person trying this.  Please reveal my
stupidity.  Thank you in advance.
--~--~-~--~~~---~--~~
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: I appear to be corrupting my datastore

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

compiling 2.5.2 from source appears to have fixed the database
corruption, though I'm still getting the http response too large error
when I try to bring up the stories now that they're scored as floating
points. If it turns out to be an appengine problem, I'll reply to this
thread, otherwise if it is just a problem with my code, I'll let this
topic die. Thanks again.

On Dec 15, 3:33 pm, bowman.jos...@gmail.com
bowman.jos...@gmail.com wrote:
 Ok great. I'll have to check on the python version, it's whatever
 xandros makes available (I haven't gotten rid of the default OS on my
 eeepc because I'm lazy). If worse comes to worse I'll try compiling
 the latest python by hand and see if that works. I should have this
 done by the weekend. I'll post a comment to the ticket if this
 resolves the issue. Thanks for the quick knowledgeable response as
 always.

 On Dec 15, 3:06 pm, Marzia Niccolai ma...@google.com wrote:

  Hi,

  I just assumed it was Mac because it's an issue we've seen with Macs that
  have 2.5.0 installed, and I'm assuming this is your Python installation?
  Generally, float values in the datastore just don't work with Python 2.5.0.
  Support for buffer objects in struct.unpack was not added until version
  54695 (Apr 2007), this is the underlying cause of the error message.

  -Marzia

  On Mon, Dec 15, 2008 at 11:54 AM, bowman.jos...@gmail.com 

  bowman.jos...@gmail.com wrote:

   This is actually happening on Linux, not sure if that matters or not.

   Clearing the datastore is my only solution to getting it back up on
   the SDK currently, but once I run the routine again, it's corrupted
   again. I did try converting the entire property to a
   db.DateTimeProperty and adding milliseconds, and had the same
   corruption issues.

   On Dec 15, 2:07 pm, Marzia Niccolai ma...@google.com wrote:
Hi,

Thanks for filing the issue.

This is related to storing a floatproperty in the SDK datastore, on Macs
   the
datastore file may get occasionally corrupted. Currently you will need 
to
clear the datastore on your local machine to fix this issue.

-Marzia

On Sat, Dec 13, 2008 at 7:52 AM, bowman.jos...@gmail.com 

bowman.jos...@gmail.com wrote:

 I didn't have much luck with switching to a datetimeproperty using
 milliseconds eithers. I also tried handling the value changing in the
 check method directly, since it looked like it was possible there.
 Same results, the datastore gets corrupted. The error I get when I try
 to start the datastore after stopping it is.

 class 'struct.error': unpack requires a string argument of length 8

 def checkScoreValue(self, value):
  valid = False
  while valid == False:
     query = db.GqlQuery('SELECT * FROM Story WHERE score = :1', value)
    results = query.fetch(1)
    if len(results)  0:
       value = value + 0.001
    else:
      valid = True
  return value

 I've filed an issue, #922 -
http://code.google.com/p/googleappengine/issues/detail?id=922

 On Dec 13, 10:01 am, bowman.jos...@gmail.com
 bowman.jos...@gmail.com wrote:
  I'm trying to make sure a score field I set for articles on my site
   in
  unique, however, I'm running into an issue where my method is
  appearing to corrupt my datastore. After I input stories, I can't
   view
  pages, getting a return size too large error, and when I stop and
  start the SDK, it won't restart.

  Here's what I'm doing.

  I set up a new Score Property.

   
  class ScoreProperty(db.FloatProperty):

  def checkScoreValue(self, value):
    query = db.GqlQuery('SELECT * FROM Story WHERE score = :1', value)
    results = query.fetch(1)
    if len(results)  0:
      raise db.BadValueError(
          'Property %s must be unique' % self.name)
    return value

  def __init__(self, verbose_name=None, name=None):
    super(ScoreProperty, self).__init__(
      verbose_name, name, required=False,
      validator=self.checkScoreValue)

   

  Then when I go to add a story, I use this try statement

   
  story_added = False
  while story_added == False:
  try:
    story.put()
    story_added = True
  except db.BadValueError:
    story.score = story.score + 0.001

   

  What should happen is that when a put is attempted, a check is done
   to
  see if a story with that score exists. If it does exist, add 0.001
   and
  try to put again. After adding several stories in batch mode, I can
  using the data view that appears to be working, but strangely. I'll
  

[google-appengine] Re: Django+Appengine vs Appengine

2008-12-15 Thread Bobby

I like the Appengine Patch's approach the best so far, i think it's
quite good.

I'll stick with Django in hopes that eventually most of the missing
Django features and apps will be ported over (either by the Django
AppEngine-Helper or the AppEngine-Patch). Right now i've got nothing
to lose.

Bobby

On Dec 15, 5:49 pm, Alexander Kojevnikov alexan...@kojevnikov.com
wrote:
  This is using the AppEngine helper (not the patch you linked to). I
  thought the AppEngine helper would make sure that the Django model
  methods would delegate to the AppEngine's version transparently but
  some seem to be missing - why is this?

 app-engine-patch does not try to replace appengine models. You end up
 with the same data access code as with the plain vanilla appengine.
 From their homepage:

   Conceptual difference [with appengine-helper]: We don't try to
 emulate Django's Model because that's impossible, anyway.

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



[google-appengine] Re: how to submit form from static index.html

2008-12-15 Thread Greg

This is easy to do. See the mail api http://code.google.com/appengine/docs/mail/
for details.

On Dec 16, 1:28 pm, rakf1 kris...@gmail.com wrote:
 I have a app running with static files, i have a form in the
 index.html which has to be emailed back to me onsubmit. Is there a way
 to do this? I have no experience with python, can this be done like
 with php? I was able to find some documentation on 
 sendmail:http://code.google.com/appengine/docs/mail/sendingmail.html, but how
 do I do this from static index.html.

 my app.yaml:

 application: xxx
 version: 1
 runtime: python
 api_version: 1

 handlers:
 - url: (.*)/
   static_files: static\1/index.html
   upload: static/index.html

 - url: /
   static_dir: static
--~--~-~--~~~---~--~~
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 submit form from static index.html

2008-12-15 Thread rakf1

I'm not starting the page using template.render (), so I cannot
implement the way in the tutorials, i'm using static index.html... is
it supposed to work if i have the sendmail in form action, like this:
---??

form action=mail.cgi method=POST ...



On Dec 15, 7:53 pm, Greg g.fawc...@gmail.com wrote:
 This is easy to do. See the mail 
 apihttp://code.google.com/appengine/docs/mail/
 for details.

 On Dec 16, 1:28 pm, rakf1 kris...@gmail.com wrote:

  I have a app running with static files, i have a form in the
  index.html which has to be emailed back to me onsubmit. Is there a way
  to do this? I have no experience with python, can this be done like
  with php? I was able to find some documentation on 
  sendmail:http://code.google.com/appengine/docs/mail/sendingmail.html, but 
  how
  do I do this from static index.html.

  my app.yaml:

  application: xxx
  version: 1
  runtime: python
  api_version: 1

  handlers:
  - url: (.*)/
    static_files: static\1/index.html
    upload: static/index.html

  - url: /
    static_dir: static
--~--~-~--~~~---~--~~
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: Difficulty Serving Static Image with static_files handler

2008-12-15 Thread Dylan Lorimer

Hi Marzia -

Thanks for your reply. So unfortunately I don't that the order of the
app.yaml entries is the culprit. Here's my app.yaml:

handlers:
- url: /photos/(.*)/(.*\.(gif|png|jpg))
  static_files: static/photos/\1/\2
  upload: static/photos/(.*)/(.*\.(gif|png|jpg))

- url: /css
  static_dir: static/css

- url: /images
  static_dir: static/images

- url: /js
  static_dir: static/js

- url: /post
  script: main.py
  login: admin

- url: /.*
  script: main.py

My site is live @ http://www.jaceyphotographs.com. You can see the
blog entry with missing img, and if you check the source you'll see
the img URL that should resolve but isn't. It is possible that my
images haven't been uploaded to app engine by the development google
app engine launcher? Is there any way to verify that they indeed are
on the server?

Did I mention that this works perfect on my development app engine
server, which is what is making this so frustrating!

Cheers,
dylan

On Dec 15, 1:42 pm, Marzia Niccolai ma...@google.com wrote:
 Hi Dylan,

 H, this is confusing because it works perfectly for me.  I made a simple
 application:

 static
  - photos
   - folder
     - image.jpg
   - folder2
     - image.jpg [different image]

 With this in my app.yaml:
 - url: /photos/(.*)/(.*\.(gif|jpg))
   static_files: static/photos/\1/\2
   upload: static/photos/(.*)/(.*\.(gif|jpg))

 And it works perfectly.

 The only thing I can think of that may not make this work is if you have
 another handler in your app.yaml that also matches those files and is
 defined before this one that is causing this issue.

 So this could 404 if your app.yaml looks like this:
 -app.yaml-
 - url: /.*
   script: main.py

 - url: /photos/(.*)/(.*\.(gif|jpg))
   static_files: static/photos/\1/\2
   upload: static/photos/(.*)/(.*\.(gif|jpg))
 -end-

 Because the first handler matches all URLs.

 Hope this helps, if not, perhaps attach your entire app.yaml file?

 -Marzia

 On Sun, Dec 14, 2008 at 12:11 AM, Dylan Lorimer write2dy...@gmail.comwrote:



  Hi,

  In my app.yaml I have the following:

  - url: /photos/(.*)/(.*\.(gif|png|jpg))
   static_files: static/photos/\1/\2
   upload: static/photos/(.*)/(.*\.(gif|png|jpg))

  My application has images that I've uploaded per the following
  directory structure:

  application root
   - static
       - photos
           -folder_1/image_1.jpg
           -folder_1/image_2.jpg

           -folder_2/image_3.jpg

  etc etc

  For the life of me I can't seem to serve these images successfully.
  Any URL hit to:www.myapp.com/photos/photo_folder_name/image_name.jpg
  results in a 404 not found.

  I'm certain this is an issue with my app.yaml static handler but can't
  figure it out. Any help is SUPER appreciated. It's possible that they
  are not being uploaded due to an error in the upload directive, but I
  don't think that's the case.

  Thanks much.
--~--~-~--~~~---~--~~
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: Ajax Updater parameters transfer

2008-12-15 Thread Shay Ben Dov

thanks, I'll implement it in the following week and let you know how
it comes out.

Shay

On Dec 15, 11:29 am, Matija matija.jerko...@gmail.com wrote:
 For '/update_tags/mark365'

 Url mapping cloud be:

 ('/update_tags/(.*)', UpdateTags),

 And class:

 class UpdateTags(BaseRequestHandler):
    def get(self, mark):

 Javascript:

 function updateTags(mark){
    new Ajax.Updater('tagging_area', '/update_tags/' + mark, {
      method: 'get'
    });

 }

 For '/update_tags?mark=mark365'

 ('/update_tags.*', UpdateTags),

 class UpdateTags(BaseRequestHandler):
    def get(self):
       mark = self.request.get('mark')

 function updateTags(mark){
    new Ajax.Updater('tagging_area', '/update_tags?mark=' + mark, {
      method: 'get'
    });

 }

 For url '/update_tags' but with mark data in POST header

 ('/update_tags', UpdateTags),

 class UpdateTags(BaseRequestHandler):
    def post(self):
        mark = self.request.get('mark')

 function updateTags(mark){
    new Ajax.Updater('tagging_area', '/update_tags', {
      method: 'post',
      parameters: { 'mark':mark }
    });

 }

 Also your template file probably should be:

 span class=itema href=javascript:updateTags({{mark}})b
 {{mark}}/b/a/span

 But good principle would be to separate presentation from behavior and
 not to have html and javascript in same file. It depends of you
 problem but something like:

 span class=itema href=# class=marks id={{ mark }}strong
 {{mark}}/strong/a/span

 And in separate javascript file you need to have one more function
 that is executed after html document downloaded:

 this in html
 script type=text/javascript
     Event.observe(window, 'load', init);
 /script

 And javascript code in separate file

 function init(){
    $$('.marks').each(function(linkMark){
        Event.observe(linkMark, 'click', updateTags);
    )};

 }

 function updateTags(mouseInfo){
    Event.stop(mouseInfo);
    var mark = mouseInfo.element().id; // or var mark =
 mouseInfo.element().readAttribute('id');

    ... and here your preferred way of sending data.

 }

 Hope that helped. Matija.

 P.S. There could be some writing errors.

 On Dec 15, 7:09 am,ShayBen Dov shay.ben...@gmail.com wrote:



  Hi,

  It should be '/update_tags/a' like when you use

  .?id={{ variable }}

  thanks,

 Shay- Hide quoted text -

 - Show quoted text -
--~--~-~--~~~---~--~~
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 submit form from static index.html

2008-12-15 Thread Alexander Kojevnikov

 I'm not starting the page using template.render (), so I cannot
 implement the way in the tutorials, i'm using static index.html... is
 it supposed to work if i have the sendmail in form action, like this:
 ---??

 form action=mail.cgi method=POST ...

No, but you can write your own handler. Use the code from the tutorial
as a starting point.

In your index.html change the form's action for example to /send-
email. Then in your send-email handler, override the post() method,
send an email using the appengine mail API, and finally redirect back
to the html page with:

self.redirect('/your-page.html')

Don't be afraid to throw in some Python code, it's really easy. Let us
know if you have troubles setting this up.
--~--~-~--~~~---~--~~
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: Unable to import non-root modules; works fine in dev_appserver

2008-12-15 Thread Alexander Kojevnikov

 Say I create a directory called code in the app root.  

I had exactly the same problem a couple of months ago, took me quite a
few hours to find a solution.

Apparently the code name conflicts with some internal modules or
packages. I ended up renaming it to app, this fixed the problem.

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



[google-appengine] Re: Any updates on deleting all entities in the production datastore?

2008-12-15 Thread Alexander Kojevnikov

Related issues:

http://code.google.com/p/googleappengine/issues/detail?id=793
http://code.google.com/p/googleappengine/issues/detail?id=169


On Dec 16, 11:50 am, Jyoti Shete-Javadekar
jyoti.javade...@gmail.com wrote:
 Hi,
 I want to delete all my data models in production environment and upload new
 set of entities. I have gone through previous threads regarding this
 requirement. So far the solution seems to be selecting bunch of entities and
 then deleting them through script or through data viewer. I tried both the
 ways but they are not efficient. I am able to delete maximum 100-200 rows at
 a time.

 Is there any update on any appengine utility to delete all models in the
 production datastore at once?

 thanks,
 Jyoti
--~--~-~--~~~---~--~~
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: Deploying to multiple Google Apps domains

2008-12-15 Thread Andrew

Thanks for the reply; let me just clarify one point.

You say that if I restrict authentication to a particular Google Apps
domain, only users from that domain will be able to login. If I use
the Google Accounts login, it is not an issue.

However, I wanted to do this: Corporation 1 and Corporation 2 both use
Google Apps. Both deploy my app. Can j...@corporation1.com and
j...@corporation2.com both login to my app?

I'm under the impression that neither of the authentication modes
would allow this sort of thing, since Google Apps authentication
requires everyone to be on the same domain, and Google Accounts
authentication requires everyone to have a Google Account (not a
company-provided Apps account).

On Dec 10, 12:34 pm, Marzia Niccolai ma...@google.com wrote:
 Hi,

 A Google App Engine app can be deployed on multiple domains.  The only
 restriction is that if you restrict authentication to a particular Google
 Apps domain, you can only serve traffic on that domain (meaning currently,
 if you want only mydomain.com users to be able to log in to your app, the
 app must be served off of mydomain.com).  If you are using Google Accounts
 for login, this is not an issue.

 If you had an issue linking your Google App Engine App to a Google Apps
 domain, it is possible this is due to some difficulties users have been
 having with the 'www' mapping.  The general directions to linking your app
 to a Google Apps domain are 
 here:http://code.google.com/appengine/articles/domains.html
 And if this fails for the 'www' mapping, see the instructions 
 here:http://groups.google.com/group/google-appengine/web/deleting-existing...

 -Marzia

 On Tue, Dec 9, 2008 at 4:22 PM, Andrew thesongeter...@gmail.com wrote:

  I've been exploring Google App Engine and working on an app, but I
  envision the app being something that would be used by different
  companies on their own Apps domains. That is, I'll want to use it on
  my Google Apps domain, but other companies might like to deploy it on
  their Apps domain as well.

  I created my app with the default setting where any Google user can
  log in. Unsurprisingly I cannot log in when I use my Google Apps
  account. I tried adding the app to my Google Apps account (since the
  Dashboard has an Add more services link that allows the adding of AE
  apps), but that didn't help at all.

  Now, I can easily create a new AE app and set it to be used on my Apps
  domain instead of being universal. But that means I'm the only one who
  can ever use the app, right? Is there any way to allow multiple Apps
  domains to access the same AE app? I assumed that was Google's purpose
  in including the Add more services option in Google Apps, but maybe
  I'm missing something.

  Thanks for any insight.
--~--~-~--~~~---~--~~
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 submit form from static index.html

2008-12-15 Thread rakf1

here is how i have setup the app.yaml, email.py and form.html, let me
know whats wrong ??, how should i setup handler for email.py in
app.yaml ??

app.yaml:
-
...
...
handlers:
- url: (.*)/
  static_files: static\1/index.html
  upload: static/index.html

- url: /
  static_dir: static
-



email.py:
-
from google.appengine.api import mail

class SendEmail(webapp.RequestHandler):
  def post(self):
user_address = self.request.get(email_address)

if not mail.is_email_valid(user_address):
  # prompt user to enter a valid address

else:
  sender_address = supp...@example.com
  subject = test
  body = test email

  mail.send_mail(sender_address, user_address, subject, body)
-



form.html:
-
form action=/SendEmail method=POST
Email: input type=email_addressinput type=submit
value=Confirm
/form
-




On Dec 15, 10:03 pm, Alexander Kojevnikov alexan...@kojevnikov.com
wrote:
  I'm not starting the page using template.render (), so I cannot
  implement the way in the tutorials, i'm using static index.html... is
  it supposed to work if i have the sendmail in form action, like this:
  ---??

  form action=mail.cgi method=POST ...

 No, but you can write your own handler. Use the code from the tutorial
 as a starting point.

 In your index.html change the form's action for example to /send-
 email. Then in your send-email handler, override the post() method,
 send an email using the appengine mail API, and finally redirect back
 to the html page with:

     self.redirect('/your-page.html')

 Don't be afraid to throw in some Python code, it's really easy. Let us
 know if you have troubles setting this up.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---