[google-appengine] Re: Shorthand to modify model-Objects?

2009-05-18 Thread djidjadji
Can you use get_or_insert to update an object with the given key_name? -- **kwds Keyword arguments to pass to the model class if an instance with the specified key name doesn't exist. The parent argument is required if the desired entity has a parent. --

[google-appengine] Re: Shorthand to modify model-Objects?

2009-05-17 Thread djidjadji
You can write a function that does it def updateAttr(obj, **kwds): if obj is None: return for k,v in kwds.iteritems(): setattr(obj,k,v) .. me = MyEnt.all().filter(index =, index).get() updateAttr(me, title = title, name=name, public=False) 2009/5/17

[google-appengine] Re: TypeError: has_key() takes exactly 1 argument (2 given)

2009-05-15 Thread djidjadji
What is the content of the template? There is a for loop executed and there it goes wrong. --~--~-~--~~~---~--~~ 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] Re: csv files

2009-05-14 Thread djidjadji
Write a python script that does the following # Afile = open(Afile.csv) Alines = Afile.readlines() Afile.close() Bfile = open(Afile.csv) Blines = Bfile.readlines() Bfile.close() for lineA,lineB in zip(Alines,Blines): # convert the lines to

[google-appengine] Re: Url Fetch

2009-05-14 Thread djidjadji
As discussed in this group: All twitter apps on GAE together are viewed by twitter.com as one app and are thus limited as a group. 2009/5/14 Paul Kinlan paul.kin...@gmail.com: Hi Emil, The requests where plain http requests to port 80 on twitter.  I am just trying to work out if it is

[google-appengine] Re: Download a doc file from HTML page

2009-05-12 Thread djidjadji
Template file must NOT be static, they must be uploaded like a normal py file 2009/5/12 风笑雪 kea...@gmail.com: Just make sure when you visit http://localhost:8080/sample.doc;, you can get a file download dialog. It seems you mistook template and static file, which are much difference from

[google-appengine] Re: Download a doc file from HTML page

2009-05-11 Thread djidjadji
If you want to serve the files dynamically you can use the method in http://code.google.com/appengine/articles/images.html 2009/5/11 风笑雪 kea...@gmail.com: Sorry, I made a mistake on the path - url: /sample\.doc static_files: static/sample.doc # no \ upload: static/sample\.doc

[google-appengine] Re: Too many indexed properties for entity

2009-05-07 Thread djidjadji
If you put the description in a BlobProperty? Maybe that is not indexed by SearchableModel 2009/5/6 Ben bhym...@gmail.com: Hello, i have implemented a relatively basic app using app engine and so far most htings are working well.  however i am having some problems using

[google-appengine] Re: How to iterate a json string using dictionary

2009-05-06 Thread djidjadji
eval() the strings you receive in the request? One way of getting to execute any python code in his application. You can use the simple JSON that comes with GAE in Django from django.utils import simplejson 2009/5/6 风笑雪 kea...@gmail.com: json = '{element1: haha, element2: 123}' d =

[google-appengine] Re: Querying a DateTimeProperty from the dashboard

2009-05-06 Thread djidjadji
http://code.google.com/appengine/docs/python/datastore/gqlreference.html In the mid of the page, convert the string to a DateTime. 2009/5/6 Paul Kinlan paul.kin...@gmail.com: Hi Guys, I might be being silly here, I am trying a query through the DataViewer that is along the lines of:

[google-appengine] Re: filter on many to many reference collections

2009-05-06 Thread djidjadji
friends = user.friends This is a query for Connections objects. Other method of writing user = User.get_by_id(uid) Connections.all().filter('friend =', user) # user.friends for friend in friends: print friend.user.key().id() This will perform a query to fetch one (1) User object for

[google-appengine] Re: documentation for memcache namespaces?

2009-05-05 Thread djidjadji
http://code.google.com/appengine/docs/python/memcache/clientclass.html#Introduction 2009/5/4 Andy Freeman ana...@earthlink.net: Where are memcache namespaces documented? (They're mentioned in http://code.google.com/appengine/docs/python/memcache/functions.html and

[google-appengine] Re: documentation for memcache namespaces?

2009-05-05 Thread djidjadji
It says: To be compatible with other memcache implementations they allow parameters and functions that have no meaning --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google App Engine group. To post to this group,

[google-appengine] Re: filter a query for distinct data in one field

2009-05-04 Thread djidjadji
You can filter on more then one property, only one filter can have an inequality operator. adminX = 'admin1' blocX = 'bloc1' que = CUser.all() que.filter('id_admin = ', adminX) que.filter('bloc = ', blocX) result = que.fetch(50) --~--~-~--~~~---~--~~ You received

[google-appengine] Re: Is there a way to do it?

2009-04-29 Thread djidjadji
That binary data must be encoded in some way so it should work. XML is encoded in some sort of character set, ASCII, UTF-8, If you want to sent some binary data you have to encode it, uuencode, BASE64, and then into the encoding of the XML file. 2009/4/29 arnie parvez...@rediffmail.com:

[google-appengine] Re: Is there a way to do it?

2009-04-28 Thread djidjadji
2009/4/28 arnie parvez...@rediffmail.com: How can I extract the contents of xml sent from the iphone using raw_post_data. http://code.google.com/appengine/docs/python/tools/webapp/requestclass.html#Request_body Also the editor that I am using does not support using breakpoints so it is not

[google-appengine] Re: How to reset my application in Google App Engine to default status (empty status)

2009-04-28 Thread djidjadji
2009/4/27 Eric Tsang erictsan...@gmail.com: For example ... 1. To Clear the content of Application to empty Use an empty application version. app.yaml redirects to non existing .py file 2. to Clear the content of DataStore to empty Use the dashboard

[google-appengine] Re: Completely clearing the datastore

2009-04-28 Thread djidjadji
You can do it from multiple threads like Alkis proposed but I think that you then try to delete an object multiple times. The index is only updated last, and committed when the delete operation succeeds. If a request comes in short after another request that is still busy with the

[google-appengine] Re: Completely clearing the datastore

2009-04-28 Thread djidjadji
http://www.lmgtfy.com/?q=Meta+Refresh 2009/4/28 Sri sri.pan...@gmail.com: Sorry for the lame question but whats a Meta Refresh? Fancy Term or Fancy Technique? http://www.lmgtfy.com/?q=Meta+Refresh --~--~-~--~~~---~--~~ You received this message because you

[google-appengine] Re: Indices keep building so long

2009-04-24 Thread djidjadji
It can take a couple of hours, depending on the amount of objects need to be indexed and the number of index entries that need to be made (exploding index). Even deleting an index can take hours, at least according to the dashboard status. And there where not much index entries in them

[google-appengine] Re: Java deploys

2009-04-24 Thread djidjadji
Every uploaded versionID of an appID can be a different application, and can be Java or Python. You access them on the following URLs http://versionID.latest.appID.appspot.com/ Fill in the right text for versionID and appID 2009/4/24 Randinn rand...@gmail.com: How many of the ten apps can

[google-appengine] Re: Get records keys from the datastore

2009-04-24 Thread djidjadji
http://code.google.com/appengine/docs/python/datastore/modelclass.html#Model_key 2009/4/24 YahavT yahav.t...@gmail.com: Hi, I want to get from the datastore a record i added plus it's key. How can I do it? If I just run a regular SELECT I just get the record data, without the key of the

[google-appengine] Re: Is there a way to do it?

2009-04-23 Thread djidjadji
How are you making the GET request at the moment? If there is no API that does HTTP on the iPhone you have to open a socket yourself and send the required HTTP lines. 2009/4/22 arnie parvez...@rediffmail.com: Please also provide a small example of a request that is sending the xml as my

[google-appengine] Re: django urlize

2009-04-23 Thread djidjadji
You must add a space between the _urls_ urlize('djangoproject.com (www.djangoproject.com)', nofollow=True) urlize is very short sighted. the following url will not be matched urlize('www.bbc.co.uk') Any other domain then .com .net .org URLs must be preceded with http:// or https://

[google-appengine] Re: Debugging App Engine errors

2009-04-23 Thread djidjadji
You get a Timeout error on a get() operation. I solved it by doing a retry when I get an exception. If the retry also failed I re-raise the exception to get it logged 2009/4/22 Morten Bek Ditlevsen morten@gmail.com: Hi there, I'm in the process of moving the database part of a social

[google-appengine] Re: Query() vs. GqlQuery() different results for the same queries (Python)

2009-04-23 Thread djidjadji
Wrong: filter(checkpoint_id=, bus.checkpoint_id) Right:filter(checkpoint_id =, bus.checkpoint_id) 2009/4/22 风笑雪 kea...@gmail.com: You mean this? Wrong: filter(checkpoint_id=, bus.checkpoint_id) Right:filter(checkpoint_id= , bus.checkpoint_id) 2009/4/22 Dmitry Kachaev

[google-appengine] Re: newbie : Template does not exist error

2009-04-23 Thread djidjadji
The templates MUST NOT be put in a static dir. Static files are not accessible to the python code to read. 2009/4/23 Jeremy jeremyburde...@gmail.com: The template directory should also contain the name of the html file. If the static dir is 'templates' and the html file is

[google-appengine] Re: Still more Datastore timeouts

2009-04-22 Thread djidjadji
This is probably caused by your datastore.history file. This file keeps record of every index that is ever needed. You can delete this file and start the server again. 2009/4/22 Paul Kinlan paul.kin...@gmail.com: [snip] Another thing I have noticed, and it is not related is that certain indexes

[google-appengine] Re: Retrieving Large Query Sets Containing Inequality Operators

2009-04-20 Thread djidjadji
Hi Chris, You can do this by adding an extra attribute to the object that contains the date and a sequence number. The extra attribute is an IntegerProperty. It has arbitrary precision, unlimited bit length. If you store (long(datetime.toordinal(myRecord.date))128)+long(sequenceNum) you can

[google-appengine] Re: Retrieving Large Query Sets Containing Inequality Operators

2009-04-20 Thread djidjadji
believe App Engine allows you to run queries in a transaction. Chris 2009/4/20 djidjadji djidja...@gmail.com: Hi Chris, You can do this by adding an extra attribute to the object that contains the date and a sequence number. The extra attribute is an IntegerProperty. It has arbitrary

[google-appengine] Re: bash: dev_appserver.py: command not found

2009-04-20 Thread djidjadji
the file you want to execute is dev_appserver.py 1) go to the directory with your app.yaml file 2) go 1 dir up: cd .. 3) in this directory you find the directory test/ 4) start the server with ~/GAE/dev_appserver.py test/ if the execute bit of dev_appserver.py is not set use python

[google-appengine] Re: Suggestion: delete google-appengine group.

2009-04-20 Thread djidjadji
http://code.google.com/appengine/community.html There are 4 groups now, the python and java groups were created at the time the java SDK was released. 2009/4/20 jamiebarrow jamiebar...@gmail.com: On Apr 17, 7:09 pm, ramu rslet...@gmail.com wrote: You can alwasy choose not to receive any

[google-appengine] Re: sort on _key_ out of order

2009-04-18 Thread djidjadji
If two requests want to create an M() they will get the same ID. You must use some kind of transaction to get unique IDs 2009/4/18 风笑雪 kea...@gmail.com: I use this code to keep an id: class M(db.Model): id = db.IntegerProperty() time = db.DateTimeProperty(auto_now_add=True)

[google-appengine] Re: Question about data.put() timeout

2009-04-17 Thread djidjadji
If you program a retry around the line plog.py, line 958, in get blogger_info.put() it will work often the second time 2009/4/17 lookgirl sag...@gmail.com: I have a running app now, and it often get many error like following, the error looks like same format xxx.put() Timeout. Could you

[google-appengine] Re: App Runs Differently When Uploaded

2009-04-17 Thread djidjadji
To be a bit more precise The (html) files you use for the templates MUST NOT be static. Otherwise the template python code can't read them. You can't read the content of a static file with f = open('file.html','r') data = f.read() f.close() This is because static files are stored in a different

[google-appengine] Re: IntegerProperty doesn't result in an int

2009-04-15 Thread djidjadji
Do you reference the IntegerProperty with the class name or with self? istr = str(MyCustomModel.iprop) # this gives your string value or istr = str(self.iprop) # this should give the integer value 2009/4/13 alex gsm...@gmail.com: Got a class that extends db.Model with an IntegerProperty

[google-appengine] Re: Transactions - Entity Groups

2009-04-13 Thread djidjadji
the games it's in) to be atomic.  What you're suggesting can fail at anywhere between 1 and 4. On Apr 12, 4:35 pm, djidjadji djidja...@gmail.com wrote: Start with answering the question: Do I need a transaction? I don't think you need it to delete a team. Every Team and every Game are root

[google-appengine] Re: GAE inter-apps communication

2009-04-12 Thread djidjadji
Terms Of Service 4.4 You can put your separate applications at different URLs of the appid with the data. http://greatappid.appspot.com/application1/ http://greatappid.appspot.com/application2/ http://greatappid.appspot.com/application3/ 2009/4/12 DarkCoiote darkcoi...@gmail.com: Humm..

[google-appengine] Re: Transactions - Entity Groups

2009-04-12 Thread djidjadji
Start with answering the question: Do I need a transaction? I don't think you need it to delete a team. Every Team and every Game are root entities, no child objects. When you want to delete a Team 1) find all Games that have the Team in attribute team1 2) delete these Games, maybe

[google-appengine] Re: Can I read the directory structure in the file system?

2009-04-11 Thread djidjadji
Hi Konrad, But according to the TOS (Term Of Service) you are not allowed to use one of your app id's for 1GB of static storage for another app id that has the dynamic content and is the actual application. The app with the static files should be a separate application. 2009/4/11 Konrad Martin

[google-appengine] Re: Can I read the directory structure in the file system?

2009-04-11 Thread djidjadji
Hi Konrad, 4.4. You may not develop multiple Applications to simulate or act as a single Application or otherwise access the Service in a manner intended to avoid incurring fees. 2009/4/11 Konrad Martin konrad...@gmail.com: Hi djidjadji On 11 Apr., 10:28, djidjadji djidja...@gmail.com wrote

[google-appengine] Re: Can I read the directory structure in the file system?

2009-04-11 Thread djidjadji
Hi Konrad, So I come to the conclusion that the usage demonstrated in my static demo example http://benchstat.appspot.com/fileHost/09/04/11/staticDemoVers1.zip is totally in line with Google's terms of service. Or do you have a different opinion? Yes, your standalone all static content

[google-appengine] Re: this cause an error ,why?

2009-04-08 Thread djidjadji
When there are no '00' in deptId then deptId and deptIdBig are equal. How can something be =x AND x. 2009/4/8 DiveIntoGAE taogf1...@gmail.com:        deptId = self.request.get('deptId','0100')        deptIdBig = deptId.replace('00','99')        personsInfoQuery =

[google-appengine] Re: Cron Schedule Format parsing error

2009-04-08 Thread djidjadji
The SDK is now at number google_appengine_1.2.0.zip http://code.google.com/appengine/downloads.html 2009/4/8 an0 an0...@gmail.com: sdk's parser fails to parse the example from the doc: - description: monday morning mailout  url: /mail/weekly  schedule: every monday 9:00 Error parsing

[google-appengine] Re: Unsupported operand type(s)

2009-04-08 Thread djidjadji
c = Greeting.count + 1 TypeError: unsupported operand type(s) for +=: 'IntegerProperty' and 'int' Inside a method of the Greeting class you don't reference the count property with the class name but with 'self'. If you use Greeting.count you are using the class variable 'count' not the

[google-appengine] Re: Can not update db

2009-04-07 Thread djidjadji
You must first execute the query before you can access the objects You can use get() or fetch() dests = db.GqlQuery( SELECT * FROM Dj_User WHERE UserID = '4' ) dests.fetch(1000) dests[0].UserName = aaa# it seems something wrong here db.put( dests ) [1]

[google-appengine] Re: ReferenceProperty and Filtering

2009-04-06 Thread djidjadji
You must first find the Model1 objects that have the required fieldModel1 value Then get the keys for those models and then find the Model2 objects that have a model1 value that matches one of those keys 2009/4/5 pjfitz fitzpatrick...@googlemail.com: Hi, I cannot seem to filter on field names

[google-appengine] Re: Can't direct app engine server to the yaml file

2009-04-06 Thread djidjadji
try, inside a command window c: cd C:\test dev_appserver helloworld\ 2009/4/6 Banaticus banati...@gmail.com: I installed Python 2.5.4 and the Google App Engine.  I created a folder named test on the C drive, with a folder named helloworld inside it.  In that, I put the app.yaml file and

[google-appengine] Re: Fastest Templating on AppEngine?

2009-04-04 Thread djidjadji
On GAE all template engines should be pure python code. At some comparison tables the Django engine was not very fast, but in terms of ms that it adds to your respons time it doesn't matter much which engine you use. The Django template I used in my tests just added a few ms to the total time.

[google-appengine] Re: Existing Kinds Not Showing in Datastore List

2009-04-04 Thread djidjadji
That list of Kinds is cached. It will update after 15 or 30 min. If not let us know. 2009/4/3 Ed edgam...@gmail.com: Hi, I recently created, loaded with objects, and queried two new Kinds having exactly the same fields as Kinds currently visible in the Datastore drop-down list.  The new

[google-appengine] Re: Control Packages

2009-04-04 Thread djidjadji
Static files can't be opened by your python code. Just remove them form your app.yaml file. They will be uploaded and you can use them as templates. 2009/4/3 Viktar karp...@gmail.com: I am trying to create package for controls. Here is my folder structure: /controls   items.py  

[google-appengine] Re: how to execute a href .... using google apps

2009-04-04 Thread djidjadji
Work trough the example it will answer a lot of your questions [1] http://code.google.com/appengine/docs/python/gettingstarted/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google App Engine group. To post to

[google-appengine] Re: test data for my model

2009-04-04 Thread djidjadji
If you can't use the Datastore Viewer to create an entity, create an entity when you request a special url user = User(UserName=aa,Password=pass,FirstName=Ronn, LastName=Ross) user.put() 2009/4/4 Ronn Ross ronn.r...@gmail.com: I have a simple model like so: class User(db.Model): UserName =

[google-appengine] Re: How to update DB record

2009-04-04 Thread djidjadji
If you don't have a primary key in your object model you should use key_names. Don't rely on the object ID's that are given. To update an object in the datastore you first retrieve it with a query. Change the members of the object. and put the object back phrase = Phrases.get_by_id(2) # or

[google-appengine] Re: One Page at a Time

2009-03-27 Thread djidjadji
http://code.google.com/appengine/articles/paging.html --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google App Engine group. To post to this group, send email to google-appengine@googlegroups.com To unsubscribe

[google-appengine] Re: HTMLParser error?

2009-03-26 Thread djidjadji
As far as I have looked at the source code for HTMLParser, it can't handle other charsets then ASCII. 2009/3/26 秦锋 feng.w@gmail.com: When I'm using HTMLParser to access a link below: http://www.stats.gov.cn/tjsj/ndsj/2007/html/C0301c.htm SDK keeps reporting: preTraceback (most recent

[google-appengine] Re: @login_required usage

2009-03-24 Thread djidjadji
For a normal dictionary you use the following to delete a key-value pair del request.session['myid'] 2009/3/24 arnie parvez...@rediffmail.com: For a logged in user I have created a session as below request.session['myid'] = somevalue This will create an entry in Session datastore table.

[google-appengine] Re: Files not updating?

2009-03-24 Thread djidjadji
You have a limit of 250 times update a day. See your quota page near the bottom. I had a problem too that not all the new static files where visible after the upload. That only happened when I did an update for the default version. Now I alternate between two version numbers and only update the

[google-appengine] Re: hard to fetch a single entry

2009-03-23 Thread djidjadji
It probably is a Datastore timeout. If you retry it mostly works. 2009/3/23 neoedmund neoedm...@gmail.com: why this happens? a model has 100,000+ entries in it. q=Foo.all() e=q.get() error occurs:  File /base/python_lib/versions/1/google/appengine/ext/db/ __init__.py, line 1346, in

[google-appengine] Re: Random error in access to db: Error! class 'google.appengine.api.datastore_errors.Timeout'

2009-03-21 Thread djidjadji
I have these types of errors and guido suggested that they might be datastore time outs in disguise. To fix the problem put a try catch around the get() call and execute the statement again by using a while loop and an attempt counter, this counter is incremented in the catch clause. attempt = 1

[google-appengine] Re: Querying GAE Datastore for TIME only values in a DATETIME field.

2009-03-20 Thread djidjadji
You probably want to sort based on the dateindex, your Model is named Trend24Hr. Your best shot is to add a Integer property that just describes the hour, values [0..23]. Expanding your schema is not hard. Follow the directions in [1]. Make sure you first update the code that adds new values to

[google-appengine] Re: Expected Database Performance with Millions of Rows?

2009-03-19 Thread djidjadji
You can eliminate the batch get when iterating the query, by fetching all the itemAs in one call. If you will process ALL the objects from a query, get them ALL, and then iterate. def myQuery(): query = A.all().filter('intProperty', val).filter('date =', date).fetch(1000) itemBkeys =

[google-appengine] Re: Django Block feature and Google App Engine

2009-03-19 Thread djidjadji
and you have to rename your main.html to base.html 2009/3/10 kd dias@gmail.com: Hi Morten, Not sure if it's a typo or not, but the issue might be the template you're rendering with MainHandler. Try template.render ('content.html','')) On Mar 9, 12:05 am, Morten Bruhn

[google-appengine] Re: Question about transactions and Entity Groups

2009-03-19 Thread djidjadji
Why do you need a transaction for this operation? To create B objects that are children of some A use a=A() a.put() # create the parent object bObjs = [B(parent=a, somestring=s) for s in somelist] db.put(bObjs) 2009/3/19 Anonymous Coderrr greedw...@gmail.com: Hi, The documentation for

[google-appengine] Re: Reading from a static text file

2009-03-16 Thread djidjadji
Why don't you put the file in the datastore. You can put it on a word basis, one object for every word, db.StringProperty. Use the datastore index to find the word. Use bulk_upload to fill the datastore. Or split it up in parts, each part starting with a different character. Put it in

[google-appengine] Re: sending email from your development server

2009-03-16 Thread djidjadji
It's all in the docs of appengine [1] [1] http://code.google.com/appengine/docs/python/tools/devserver.html#Using_Mail --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google App Engine group. To post to this group,

[google-appengine] Re: Read file as String..?

2009-03-16 Thread djidjadji
Static files are stored differently on GAE. You can't open them in your python code. --~--~-~--~~~---~--~~ 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] Re: Problem when storing a integer into a model(GQL)

2009-03-15 Thread djidjadji
ManifestVersion.all() returns a Query object. You must get or fetch them before you can use the objects def incrementVersion(): versionList = ManifestVersion.all().get() versionList.versionNumber += 1 versionList.put() return versionList.versionNumber Execute this type of functions

[google-appengine] Re: Read file as String..?

2009-03-15 Thread djidjadji
Make sure it's not a static HTML file file = open('blabla.html') content = file.read() file.close() 2009/3/16 jago java.j...@gmail.com: Hi, There is a html-file whose content I want to use inside the app engine. Whats the python code to get this file as a string?

[google-appengine] Re: Empty variable tag error

2009-03-09 Thread djidjadji
It is a small bug in the Django template renderer to not show the token that causes the error in the exception message, the token variable is passes to the Parser.error() method. In your case the token.contents is None or False so no extra info if printed. The only solution you have is to strip

[google-appengine] Re: BadRequestError: offset may not be above 1000

2009-03-08 Thread djidjadji
Make multiple queries. Use a value from the last object retrieved to select new objects with a greater value, __key__ is a good field to use, or use the field you sort on. Make sure you will stay within 30 sec wall clock time. 2009/3/8 Let Delete My Apps davide.rogn...@gmail.com: Sorry but I

[google-appengine] Re: ValueError: invalid literal for int() with base 10

2009-03-07 Thread djidjadji
self.request.get(id) returns a unicode string. You must first make a regular string out of it before casting it to int. photo = Photo.get_by_id(int(str(self.request.get(id 2009/3/1 wsun sunwe...@gmail.com: I upload an image to GAE, *.py: photo =

[google-appengine] Re: How to do this?

2009-03-07 Thread djidjadji
You can add hidden fields to your form that contain the data from the previous forms. And when the final form is accepted you create the user in the datastore. 2009/3/7 arnie parvez...@rediffmail.com: It is still very confusing as I am not able to point out what to do Let me explain my

[google-appengine] Re: Basic Python GSQL Question..

2009-03-07 Thread djidjadji
You only create the query you have to execute it to fetch the objects. If you print your object_a variable you will see it is a Query object. # you have to use the same limit number, or leave it out of the query objects = object_a.fetch(200) objects.extend(object_b.fetch(200)) for object in

[google-appengine] Re: Is it possible to do file operations ??

2009-02-22 Thread djidjadji
You are not allowed to write to a file on the production server. You can read from a file. But not from a static file. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google App Engine group. To post to this group,

[google-appengine] Re: uploading my app

2009-02-21 Thread djidjadji
If you put 'login:admin' to all your request handlers in the app.yaml file only administrators can get results for queries. Static files can be viewed, but you must know the URL and they often are not the stuff you want to hide during development. [1]

[google-appengine] Re: Problem with javascript on the appengine.

2009-02-20 Thread djidjadji
Are your javascript files declared as static files in the app.yaml file? Can you post the section of the app.yaml file and the part of the html that loads the javascript? Can you get the javascript files when you enter the URL in your browser like http://appid.appspot.com/js/window.js This is

[google-appengine] Re: pass dict() to db.Model subclass?

2009-02-20 Thread djidjadji
You must expand the dictionary into named-arguments No need to specify parent and key_name arguments, they have default values keys=['a','b','c'] values=['1','2','3'] data = dict(zip(keys,values)) person = Person(**data) --~--~-~--~~~---~--~~ You received this

[google-appengine] Re: Operand error

2009-02-18 Thread djidjadji
What you want is that there is only one TotalDistance object in the datastore. Just as Alexander points out that you have an attribute name that is the same as a method of the class Query. And you must execute the query to get objects. Better code is the following, in your post() method: You must

[google-appengine] Re: query over two properties

2009-02-16 Thread djidjadji
GAE queries do not allow AND and OR operators. For your problem you have to combine the results from 2 queries. One on the 'to' field and one on the 'from' field. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

[google-appengine] Re: Allow dev_appserver to check for updates on startup? (Y/n)

2009-02-13 Thread djidjadji
In the following file of the SDK google_appengine/google/appengine/tools/appcfg.py on line 702 (SDK 1.1.8) in function AllowedToCheckForUpdates() you find the question, edit the code to give the variable 'answer' the value 'n' Or look for a file named .appcfg_nag put in the home directory ~/

[google-appengine] Re: Inconsistency between dev_server and production server on sharded counter behaviour.

2009-02-08 Thread djidjadji
If you have different behavior on dev_appserver and the production server you should file a bug report in the issue list http://code.google.com/p/googleappengine/issues/list At least dev_appserver should report the transaction problem the same as production. dev_appserver has code to check for

[google-appengine] Re: urlfetch problem

2009-02-08 Thread djidjadji
Did you use urllib.urlencode() to construct the parameter part url = 'http://server/index.php' url_fields = { 'auth': authstring } url_fields = urllib.urlencode(url_fields) result = urlfetch.fetch(url+'?'+url_fields) --~--~-~--~~~---~--~~ You received this

[google-appengine] Re: Inconsistency between dev_server and production server on sharded counter behaviour.

2009-02-07 Thread djidjadji
Every GeneralCounterShard is an entity group. A transaction can only operate on ONE entity group. Your transaction code accesses every GeneralCounterShard for a given name. With sharded counters you NEVER have a perfect value for the total count. The value for get_count() = Sum(shards) You use

[google-appengine] Re: I would like to upload a word document to data store

2009-02-02 Thread djidjadji
Treat it just like images http://code.google.com/appengine/docs/python/images/usingimages.html 2009/2/1 Shashi kiranshash...@gmail.com: Group, I would like to develop an Google App Engine application where the user will be asked to upload a document in word or pdf ? How do I go about it

[google-appengine] Re: Design consideration

2009-01-31 Thread djidjadji
The strength of GAE is to handle many simultaneous requests (scalability). If they only read objects then there is absolutely no lock problem. If multiple requests want to write-to/update a single object/entity-group you can get collisions. They are resolved by executing your code in a

[google-appengine] Re: App Engine Datastore loses data?

2009-01-30 Thread djidjadji
You can use the method as described in [1] to walk over all your entities (following a bit of pseudo code) result = Model.all().filter('__key__ =', val).fetch(11) db.put(result[:10]) #Put back the first 10 if len(result)==11: newval = result[10].key() If you just use a single filter all the

[google-appengine] Re: datastore accumulator with (default=0)

2009-01-28 Thread djidjadji
You forget to put() the created object before you access fields that probably are set when you store the object, not when you create the object. log = Log(key_name=billy,job=write,comment=good work) log.put() --~--~-~--~~~---~--~~ You received this message

[google-appengine] Re: GAE datastore insertion rate

2009-01-27 Thread djidjadji
Why do you put all nodes for a device in one entity group (same parent node)? Entity groups should be kept small (in most cases) because you lock all members of the group if you do a put() on one of them. Only use entity groups if you need some transaction function to do the update on some of the

[google-appengine] Re: SDK as a cache ?

2009-01-24 Thread djidjadji
Performance of the local datastore is *slow* if you have 1000's of objects. Some applications have millions of objects in Bigtable. The local datastore is just to try your datamodel on a very small subset of the actual data. --~--~-~--~~~---~--~~ You received

[google-appengine] Re: How expensive are queries

2009-01-22 Thread djidjadji
Using get(key) is faster then a Model.gql().fetch() or Model.all().fetch(). db.get(key_list) is faster. But still you have to go to the datastore and that takes time. But getting data from memcache is very fast. Why don't you cache the result from the template rendering? The only extra Python

[google-appengine] Re: what is wrong with Category.all().filter(c_name=,'ddd'),return nothing?

2009-01-20 Thread djidjadji
Category.all().filter(c_name =,ddd) Watch the space character after c_name --~--~-~--~~~---~--~~ 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] Re: why does Foo.all.filter get nothing?

2009-01-20 Thread djidjadji
query = Cat.all().filter('name =','c').filter('year =',2009).filter('month =',1) Gives a Query object as return, not a []. you have to fetch() or get() from this query query.fetch(limit=100) query.get() # get the first one 2009/1/20 dd wjtbo...@gmail.com: i have a record like : c =

[google-appengine] Re: Rendring data on django from ulrfetch

2009-01-20 Thread djidjadji
Have you tried it with a smaller/shorter 'full_page_content'? template_values = {'full_page_content': 'My Test String', } The doc in the example is pretty big. Or after your conversion it is big. Python complains that the data is too large for a string. page_content = 'pre%s/pre' My

[google-appengine] Re: Rendring data on django from ulrfetch

2009-01-20 Thread djidjadji
If I fetch the given page I get a HTML file of size ~51000 bytes. If I just save the text of the document I need ~11000 bytes. If you find this on the development server you can edit the django file and insert some debug. What are the 'bits' that need to be joined? There individual length? How

[google-appengine] Re: Fetch callback

2009-01-20 Thread djidjadji
And don't forget the '?' character test = urlfetch.fetch('http://yourappid.appspot.com/check?'+check) 2009/1/19 Gipsy Gopinathan gipsy.ra...@gmail.com: I think you have to use the absolute path in your fetch call ie test = urlfetch.fetch('http://yourappid.appspot.com/check'+check)

[google-appengine] Re: what is wrong with Category.all().filter(c_name=,'ddd'),return nothing?

2009-01-20 Thread djidjadji
fir filter() after that. This is my fault.and luckily i find it. thank djidjadji! --~--~-~--~~~---~--~~ 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

[google-appengine] Re: Ok I know it's something really dumb but how to upload

2009-01-19 Thread djidjadji
You can copy and paste by using the System menu of the window. You can open this menu by using Alt-Space or click on the top left icon in the titlebar (for a cmd window it is a small c:\) In this menu you find a submenu for clipboard operations. If you want to copy text to the clipboard you first

[google-appengine] Re: How expensive are queries

2009-01-19 Thread djidjadji
Sometimes the Datastore takes longer then expected. You don't have to take action for the CPU used in the Datastore operations. What you need to optimize is the Python code you write yourself, don't do heavy math. If you only do template stuff with the retrieved objects you will not get entrys in

[google-appengine] Re: StingListProperty and bulkLoad

2009-01-18 Thread djidjadji
Have you tried implementing the HandleEntity() method of your bulkload.Loader sub-class. Find a format that you can use to put your list of strings inside a single string, choose a separator that is not found in any possible string. example: string1@@string2@@string3 In HandleEntity() convert

<    1   2   3   4   5   >