[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@go

[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 = [A.type

[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 : > > 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 wrote: >> Hi Guys, >> >> F

[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 : > > Hi, > > The documentation for entity-groups and t

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

2009-03-19 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 us

[google-appengine] Re: Random error in access to db: Error!

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: 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 : > > 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 get >    

[google-appengine] Re: updating schema

2009-03-23 Thread djidjadji
You must convert the text version of the date back to a datetime.datetime object. Use the datetime.datetime.strptime(date_string, format) method 2009/3/24 thebrianschott : > [snip] > >    next_url = '/update_datastore?date=%s' % urllib.quote(next_date) >   res = map(safe_map.__getitem__, s) >

[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 : > > 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. > When the user logout I

[google-appengine] Re: updating schema

2009-03-24 Thread djidjadji
rianschott : > > Djidjadji, > > Thanks very much for the reply. I ended up needing to use > both strftime() and strptime() as you can see in my updated > code. Another wrinkle I had to overcome was I had to reverse > the sort order and the comparison inequality to pass through > *all* th

[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: 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 秦锋 : > > When I'm using HTMLParser to access a link below: > > http://www.stats.gov.cn/tjsj/ndsj/2007/html/C0301c.htm > > SDK keeps reporting: > > Traceback (most recent call last): >

[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 f

[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. The

[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 : > > 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 Kinds, however, a

[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 : > > I am trying to create package for controls. Here is my folder > structure: > > /controls >   items.py >   __init__.py > > /con

[google-appengine] Re: how to execute

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 t

[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 : > I have a simple model like so: > class User(db.Model): > UserName = db.StringP

[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 phras

[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 : > > Hi, > I cannot seem to filter on field names of ReferenceProperty field

[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 : > > 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 helloworld.py fil

[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] http://code.google.com/appengin

[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 : > >        deptId = self.request.get('deptId','0100') >        deptIdBig = deptId.replace('00','99') > >        personsInfoQuery = db.Query(BS_EMPLOYEE_BASEINFO) >        PersonsInfo = persons

[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 : > > 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 yaml file: >

[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 th

[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 : > > Hi djidjadji > > On 11 Apr., 10:28, djidjadji wrote: >> one of you

[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: 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 : > > Humm.. Didn't remember that, a

[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 delete

[google-appengine] Re: Transactions - Entity Groups

2009-04-13 Thread djidjadji
ake, I need the deletion of a team (and all 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 wrote: >> Start with answering the question: Do I need a transaction? >> >>

[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 : > > Got a class that extends db.Model with an IntegerProperty among the > othe

[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 : > > 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 give

[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: 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 风笑雪 : > I use this code to keep an id: > class M(db.Model): > id = db.IntegerProperty() > time = db.DateTimeProperty(auto_now_add=True) >@staticmethod >de

[google-appengine] Numeric range for IntegerProperty and FloatProperty?

2009-04-20 Thread djidjadji
On page http://code.google.com/appengine/docs/python/datastore/typesandpropertyclasses.html There is no mention of the range of numbers that can be stored in an IntegerProperty and a FloatProperty. The Python 2.5 doc says: the range of a Python int can be found with sys.maxint With http://shell

[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 s

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

2009-04-20 Thread djidjadji
I don't believe App Engine allows you to run > queries in a transaction. > > Chris > > 2009/4/20 djidjadji : >> >> Hi Chris, >> >> You can do this by adding an extra attribute to the object that >> contains the date and a sequence number. >&g

[google-appengine] Re: can not connecton to localhost:8080

2009-04-20 Thread djidjadji
On Page http://code.google.com/appengine/docs/python/gettingstarted/helloworld.html did you started the dev_appserver.py with the following command, in a CMD window? google_appengine/dev_appserver.py helloworld/ Instead of helloworld fill in your app directory name. Did you get a print statem

[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 ~/GA

[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 : > > On Apr 17, 7:09 pm, ramu wrote: >> You can alwasy choose not to receive any mails from this group and >> read the di

[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 : [snip] > Another thing I have noticed, and it is not related is that certain indexes > keep getting creat

[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 : > > Please also provide a small example of a request that is sending the > xml as my iphone application do not

[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:// urlize('http:/

[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 : > > Hi there, > I'm in the process of moving the database part of a social networking > site to G

[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 风笑雪 : > You mean this? > Wrong: filter("checkpoint_id=", bus.checkpoint_id) > Right:filter("checkpoint_id= ", bus.checkpoint_id) > > 2009/4/22 Dmitry Kachaev >> >> I got it,

[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 : > > The template directory should also contain the name of the html file. > If the static dir is 'templates' and the html file is > 'test_template.html', then it'd look li

[google-appengine] Re: django urlize

2009-04-23 Thread djidjadji
There is a piece missing at the end, the regex is not complete > \$\-_.!~*'(),])|(?:%[a-fA-F\ --~--~-~--~~~---~--~~ 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-ap

[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 2009/4/23

[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 : > > How many of the ten apps can be Java, I have o

[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 : > > 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 record. > > f

[google-appengine] Re: Making the datastore readonly temporarily

2009-04-28 Thread djidjadji
If you don't have to do it often you can use the following method. Make a version of the application that displays a page that the site is temporarily under maintenance. Give an estimate for how long it will take. app.yaml redirects all requests to maintenance.py Find a time of day where the sit

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

2009-04-28 Thread djidjadji
2009/4/28 arnie : > > 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 possible for me t

[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 : > 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 http://appengine.google.com/dashboard?app_id=XX

[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 "objects=q.fetch

[google-appengine] Re: Why I got an OverQuotaError?

2009-04-28 Thread djidjadji
You can queue the mails to be send in the datastore and let 1 or more cron jobs monitor the queue and send the mails 2009/4/28 风笑雪 : > I think I find the reason now. > There is a Maximum Rate Quote for email, for free account it's 8 > recipients/minute. > --~--~-~--~~~---

[google-appengine] Re: Completely clearing the datastore

2009-04-28 Thread djidjadji
http://www.lmgtfy.com/?q=Meta+Refresh 2009/4/28 Sri : > > 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 are subscribed to th

[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 : > > There will be some binary

[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: 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 : > > Where are memcache namespaces documented? (They're mentioned in > http://code.google.com/appengine/docs/python/memcache/functions.html > and http://code.google.com/appengine/docs/python

[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: 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 风笑雪 : > json = '{element1: "haha", element2: 123}' > d = eval(json) > print 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 : > Hi Guys, > > I might be being silly here, I am trying a query through the DataViewer that > is along the lines of: > > SELECT * FROM SearchC

[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 e

[google-appengine] Re: Show "processing" message to user while Urlfetch works

2009-05-07 Thread djidjadji
http://www.javascript-coder.com/javascript-form/javascript-form-submit.phtml Use the method in the page. Don't use a submit button but a tag with an onClick attribute. In the Javascript function update some Tag with the "I'm starting the lookup" text and then submit the form. When the request i

[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 : > > 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 search.SearchableModel. > > I have

[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 风笑雪 : > Sorry, I made a mistake on the path > - url: /sample\.doc > static_files: static/sample.doc # no "\" > upload: static/sample\.doc > 2009/5/11 Satyajit

[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 风笑雪 : > 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 each other, in

[google-appengine] Re: What's the difference among key, id, and key name?

2009-05-13 Thread djidjadji
If you ask this type of question you obviously are not the writer of the application. Or have not read the code. Do a search for "key_" on the code and all will be clear. 2009/5/12 Oliver Zheng : > > I have been looking at the stored data of some apps, and noticed those > 3 columns. Key appears t

[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

[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 : > Hi Emil, > > The requests where plain http requests to port 80 on twitter.  I am just > trying to work out if it is related to Twitter's pro

[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-appeng

[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 astrid.thuec...@googlem

[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. -- 2009/5/18

[google-appengine] Re: Date Sorting With A Twist

2009-05-19 Thread djidjadji
This might be a method to get an ordered list of leagues league_list = models.League.all().fetch(1000) match_list = models.Match.all().order('date').fetch(1000) league_dict = {} for league in league_list: league.matches = [] league_dict[league.key()] = league # distribute matches to the lea

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

2009-05-19 Thread djidjadji
def get(self): query = db.GqlQuery("Select * from TaskLog") TaskLogs= query.get(); self.renderPage('templates/list.html', TaskLogs) Template {%for TaskLog in TaskLogs%} -- There are two things wrong with this python code The seco

[google-appengine] Re: Problem with deploying/serving static images

2009-05-22 Thread djidjadji
I don't know if the "bug" is solved but: try to upload to a version that is not the default version. Then make this the default. A while back GAE had trouble serving new static content when you uploaded to a default version number. --~--~-~--~~~---~--~~ You receive

[google-appengine] Re: Need help with making additational html pages

2009-05-27 Thread djidjadji
If you are serving the pages dynamic look at http://code.google.com/appengine/docs/python/tools/webapp/ If the pages are static look at http://code.google.com/appengine/docs/python/config/appconfig.html#Static_File_Handlers --~--~-~--~~~---~--~~ You received this

[google-appengine] Re: How do I make a deployed app private?

2009-05-28 Thread djidjadji
Use a version string like 'secret2me' and upload. Use the URL http://secret2me.latest.myappid.appspot.com to test the app 2009/5/28 Joseph Turian : > > While I am developing, I would like the deployed app to be private. > I only want a few Google accounts to be able to view the app. > > How do I

[google-appengine] Re: Design Question - Large Datastore Objects

2009-06-05 Thread djidjadji
One huge object would be very inefficient. You have to retrieve the whole lot every time you get() a BaseObject. You are limited to a total size of 1 Mbyte per object. Much cleaner is the approach with the two object Models. Now you can have an unlimited number of SubObjects and let the index do

[google-appengine] Re: Design Question - Large Datastore Objects

2009-06-05 Thread djidjadji
that object within a DataStore > call... > > On Jun 5, 9:50 pm, djidjadji wrote: >> One huge object would be very inefficient. You have to retrieve the >> whole lot every time you get() a BaseObject. You are limited to a >> total size of 1 Mbyte per object. >> >> Mu

[google-appengine] Re: Design Question - Large Datastore Objects

2009-06-06 Thread djidjadji
t.all().filter > (somefilter) > > Thanks! > > On Jun 6, 1:26 am, Tim Hoffman wrote: >> Even easier would be to have every subobject hold a reference to the >> parent BaseObject >> >> Then given any BaseObject  you can >> >> mybaseobject.subobject

[google-appengine] Re: Data Preload Script Equivalent?

2009-06-12 Thread djidjadji
Or use the remote api [1] and write a python script on your local computer to parse the file with insert statements and create the objects. This is kind of what bulkupload does but using CSV files for input. If you parse the file into a dictionary, key=attribute name. You can use myObj = MyObject

[google-appengine] Re: Shorten keys on URLs

2009-06-17 Thread djidjadji
In a Google IO 2009 talk Bret Slatkin told that to get shorter keys you should have short Model Names and keynames. 2009/6/14 david : > > Hello everyone, > > I've been looking for a way to shorten keys on URLs, for example: I > learned that an entity key is built from the app id and a path to tha

[google-appengine] Re: Retrieving size of collection set

2009-06-23 Thread djidjadji
You can construct a __key__ only query and count them up. Then you don't have to construct all the A objects just for counting. result = A.all(keys_only=True).filter('refprop =', b.key()).fetch(1000) numA = len(result) 2009/6/22 Nick Johnson (Google) : > Hi johntray, > > On Sun, Jun 21, 2009 at

[google-appengine] Re: Does cron jobs take more time to init than normal handlers

2009-06-24 Thread djidjadji
It could be that the cron jobs are run on a different farm of computers. If you call cron every 5 min it means the server has to start cold for every cron request. If you use the regular URL from a browser or such you likely have a warm server running. 2009/6/24 Mariano Benitez : > > Hello, > > N

[google-appengine] Re: Using the Humanize part of Django templates

2009-06-24 Thread djidjadji
Forget the settings.py file. Have you tried to import the humanize file in the .py file that uses the templates that needs these filters import django.contrib.humanize.templatetags.humanize The code will register the filters during the load. NO need to use {% load humanize %} because the filters

[google-appengine] Re: Request: Task Queue quota increase

2009-06-25 Thread djidjadji
That means that you have 100E6/24/60/60 = 1157 tasks per second. I wish I had a site that had that many requests per second. 2009/6/25 Ben Nevile : > > Seconded.  For the queues to be useful for some of the applications I > currently use client-side polling to accomplish, the daily number of > ta

[google-appengine] Re: Lots of errors, using tasks to delete all the data of an app, is my experience typical?

2009-06-28 Thread djidjadji
For the Transaction to succeed more often you can lower the rate at which the tasks are called. They battle for the same entity group simultaneous. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Google App Engine"

Re: [google-appengine] Working with Query results

2010-11-10 Thread djidjadji
RESULTS = QUERY.fetch(10) RESULTS.sort(key=lambda x: x.mDATE.toordinal() * x.mCOUNT) What is a "list of model instances? You can start by learning some basic python. Read the tutorial on the python.org website, or in the help file (on windows platform) 2010/11/10 Zeynel : > Can someone help me un

Re: [google-appengine] Re: Body of a GET request

2010-11-12 Thread djidjadji
A GET request has NO body. A POST request has a body. 2010/11/12 MasterGaurav : > Hi Anton, > > I do not see anything in the request that suggests it has a body! > > What makes you suspect that... > > > -- > Happy Hacking, > Gaurav Vaish > www.mastergaurav.com > > > On Nov 12, 2:25 pm, "anton.bely

Re: [google-appengine] Re: Body of a GET request

2010-11-12 Thread djidjadji
I don't think that '/' and ':' are allowed characters in a GET parameter. You should try urllib.urlencode and see what it constructs and which chars are excaped with the given set of parameters. If this is an illegal GET request parameter list you might expect the parser to bail out and repost: NO

Re: [google-appengine] Re: How do you use the development server for testing

2010-11-14 Thread djidjadji
if you add a __str__() method to the class that returns a string you want to print instead of the default handle number class Rep(object): def __init__(self): self.sint = 5 # some other init stuff pass def __str__(self): return "" % self.sint Maybe adding a

Re: [google-appengine] Can't move down then up the directory tree for inserting of html files with {% include %}

2010-11-16 Thread djidjadji
The template code between 0.96 and 1.1.2 is not changed (much). The include template node is looking relative to the directories in django.conf.settings.TEMPLATE_DIRS Find out what is in this list or tuple and write the include path relative to one of the given directories. 2010/11/14 Brian : >

Re: [google-appengine] Tasks and GAE Maintenance

2010-11-17 Thread djidjadji
To my knowledge: Yes. The task queues execution is put on hold. When the read-only period is over the task queue will processes tasks. 2010/11/17 Matt : > Hi there, > Very quick question: > During GAE maintenance will my code be able to add tasks to queues? > > Thanks in advance, > Matt > > -- > Y

Re: [google-appengine] Re: Data inconsistency

2010-11-20 Thread djidjadji
What if you upload the same code to a different version and make that current? That should kill all the instances running the old version. 2010/11/19 Sanjay : > I'm pretty sure the data consistency is not in our application because > of the characteristics of the problem.  I do not use Memcache or

Re: [google-appengine] Re: What's the red and blue bars in AppStats?

2010-12-12 Thread djidjadji
The usage of Appstats on the development environment is to determine if the request is not performing to many RPC calls. Doing transactions in a loop is a nice example that might be optimized. Don't compare the execution times of the development and production. They have very different implementat

Re: [google-appengine] Enhancement/Concept for Foreign Property Synchronization within Models

2010-12-14 Thread djidjadji
What happens when a multiple put is performed? The Sync must be done before constructing the protocol buffer. Are the Author entities fetched in parallel or serial? And how to deal with it if the multiple put contains different types of objects where all or some have Sync properties? Nick Johnson

Re: [google-appengine] Re: This request used a high amount of CPU and may soon exceed its quota - 2010/2011

2010-12-23 Thread djidjadji
The text for this quota warning originated in 2008 or begin 2009. At that time there was a more strict quota on CPU usage. Now you use the warning to locate requests that might be up for an improvement. Inspect the request with app-stat and rethink the code used. 2010/12/23 Matija : > I understand

Re: [google-appengine] Re: Taskqueue payload

2011-01-05 Thread djidjadji
If you use the deferred API from google.appengine.ext import deferred The storing of the task arguments in a datastore object is done by the API. -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to google-

<    1   2   3   4   5   6   >