[google-appengine] Model field value choices - can the list be generated dynamically?

2008-12-27 Thread Martynas Brijunas
Hi, I have a couple of model classes which are in one-to-many relationship. For example, one of the classes is a Product, and another one is Colours. I know that I can list the acceptable field values in this manner: size_code = db.StringProperty(required = True, choices = ['colour1', 'colour2'

[google-appengine] Re: Model field value choices - can the list be generated dynamically?

2008-12-27 Thread Consultuning
I think that the best way to address your problem would be using a ReferenceProperty to another object type where you list all the colors you wish to present as choices, does that work? --~--~-~--~~~---~--~~ You received this message because you are subscribed to t

[google-appengine] Re: How to sort enties making use of sharded counter?

2008-12-27 Thread David Symonds
On Sat, Dec 27, 2008 at 8:24 AM, newb wrote: > I'm wondering how a product like Digg works (even though they're not > on GAE). They have counters for each of their articles which would > have high write contention. But they somehow manage to keep their > articles sorted by count as well. The mod

[google-appengine] Re: Model field value choices - can the list be generated dynamically?

2008-12-27 Thread David Symonds
On Sat, Dec 27, 2008 at 10:07 PM, Martynas Brijunas wrote: > Why am I doing this? It is because I want to use it with the > db.djangoforms.ModelForm class. If I have a list of choices for a > field, the ModelForm automatically gives me a dropdown. If there is no > list of choices all I get is a

[google-appengine] Re: How to sort enties making use of sharded counter?

2008-12-27 Thread newb
Dave, Once again, thanks for taking the time to reply. Really appreciate the thought. I think I will remove the sharded counters in favor of a count directly on the objects I'm working with. And then adjust the model later if necessary. I guess I saw so much disucusssion of sharded counters here

[google-appengine] Re: How to sort enties making use of sharded counter?

2008-12-27 Thread yejun
> "high write contention" actually is, i.e. how many writes per minute/ > second you'd have to hit to have write conflicts, i.e. when you should > consider a sharded approach. > Datastore can handle 10/s write at constant interval. So if write occurs randomly at average 2/s there be about 1% pro

[google-appengine] Store model as different name to class?

2008-12-27 Thread Anthony
Hi, Is it possible to store a model as a different name to the class name? I thought this would work but its still stored as a "Test"... class Test(db.Expando): test = db.StringProperty() class MainHandler(webapp.RequestHandler): def get(self): NewTest = Test

[google-appengine] Error in bulkupload with DateTimeProperty

2008-12-27 Thread RAJ
Hi, I am trying to upload a csv file in datastore, and I think the following error is coming because I am trying to use DateTimeProperty in it. The CSV file is having just one line of data- 0,"12/25/2008 12:00:00" Please help me. -- Error Trace INFO 2008-12

[google-appengine] Re: Store model as different name to class?

2008-12-27 Thread yejun
NewTest=type('NewTest',(Test,),{}) On Dec 27, 11:43 am, Anthony wrote: > Hi, Is it possible to store a model as a different name to the class > name? > > I thought this would work but its still stored as a "Test"... > > class Test(db.Expando): >         test = db.StringProperty() > > class MainH

[google-appengine] Re: Model field value choices - can the list be generated dynamically?

2008-12-27 Thread Martynas Brijunas
Hi Consultuning/David, > You probably want to use a ReferenceProperty to a Colour entity in > your Product model. Then, customise your form something like this: > > class ProductEntryForm(djangoforms.ModelForm): > class Meta: > model = Product > > colour = djangoforms.ModelChoiceField(Col

[google-appengine] Re: Store model as different name to class?

2008-12-27 Thread Anthony
Thanks! On Dec 27, 5:20 pm, yejun wrote: > NewTest=type('NewTest',(Test,),{}) > > On Dec 27, 11:43 am, Anthony wrote: > > > Hi, Is it possible to store a model as a different name to the class > > name? > > > I thought this would work but its still stored as a "Test"... > > > class Test(db.Expa

[google-appengine] Re: appcfg "Server Error 500"

2008-12-27 Thread samba
I was getting http 50x status code when I tried to use appcfg.py and google appengine Dashboard warned saying appcfg.py quota exceeded. On Dec 22, 1:10 pm, Panesse wrote: > How did you learn that you had exceeded your quota for application > updates? Are you sure this was the problem? > > On Dec

[google-appengine] inequality, order and limit

2008-12-27 Thread riq
Hi, This subject was mentioned in earlier posts. I'm just adding the "limit" variable to it. Basically I'm coding a high score server in GAE, and I would like to perform queries like this one: score_query.filter('score_date >', date_diff) score_query.order('-score') score_query.limit(50) Where

[google-appengine] Re: Global Time Synchronisation Guarantees

2008-12-27 Thread rvjcallanan
> How could these users know that the application used inconsistent > timestamps? Even if they knew of each other's existence, which they > don't, they don't have synchronized clocks. > It is not necessarily about users knowing anything! For a number of possible reasons (including the consistenc

[google-appengine] Re: My Christmas present: Introducing Gaebar

2008-12-27 Thread Aral
You're very welcome :) The original version I had was very tightly-coupled with my own app and it broke when the limit on offsets was introduced. It was only after we got sortable keys that it was worth making it a standalone app. Please do let me know if you run into any issues (or if you don't

[google-appengine] need creative idea for admin of GAE app via smtp2web and gmail

2008-12-27 Thread Nash-t
I'd like to allow users to admin their http://smw.appspot.com account via an email sent from their Gmail account. This would satisfy at least two use cases: 1. bulk addition of users to their smw.appspot.com group. (Gmail is convenient and familiar because of its contacts interface, etc.) 2. Conve

[google-appengine] Re: appcfg "Server Error 500"

2008-12-27 Thread Thomas Johansson
Look at the very bottom of the quota details page; You are "limited" to 250 deployments per day. Always wondered why that quota was there, but if people have been doing what samba has been doing I don't blame them. No offense, I mean, but that's gotta be iffy for the appengine cluster to deal wit

[google-appengine] Re: Model field value choices - can the list be generated dynamically?

2008-12-27 Thread Alexander Kojevnikov
> thank you very much for your suggestion to use the RefrenceProperty. I > am halfway there now. The Product form now displays a dropdown. > However, I am not really clear on how to specify what will be > displayed in that dropdown. Here is what it is displaying currently > when you open a dropdow

[google-appengine] Re: Model field value choices - can the list be generated dynamically?

2008-12-27 Thread David Symonds
On Sun, Dec 28, 2008 at 9:02 AM, Alexander Kojevnikov wrote: > You can use a custom ModelChoiceField and override its > label_from_instance() method: Nice one! The alternative is to define a __str__ method on your SizeOption class, since that is what is used to render the options in the default

[google-appengine] 1st post, template error when integrating django polls to app engine

2008-12-27 Thread ltcstyle
Hi All, It's my first time here, also my first time to write django app and use app engine. Once I followed the django turtorials, I tried to integrate this django app to app engine. Done all the main.py, app.yaml and models modifications. When I check /polls/, it give me an TemplateSyntaxError

[google-appengine] Error while uploading the App

2008-12-27 Thread getitworking
Dear all, I am trying Google App engine first time. I have created the application on appspot and the application is working good locally on my Laptop. I tried uploading it with my email id and password but after entering the password 2nd time (it asked the password twice) it gave the error as:

[google-appengine] How-to display feeds in App Engine pages

2008-12-27 Thread rastafareye
I need more tutorials. I need more basic tutorials. I'd like more basic video tutorials. I need really a basic how-to on displaying RSS feeds in App Engine (Django?) pages. (Everyone keeps saying how simple Django is; but, if its so simple, why is there no drag and drop GUI?) I'd also like to

[google-appengine] Re: Query for related posts (from post title and tags) in GAE data store...

2008-12-27 Thread Mir Nazim
On Sat, Dec 27, 2008 at 12:54 AM, maverick wrote: > > Hi, > > I am improving my own blog on GAE, one great feature wordpress (with > certain plugins) has is the "related posts", when you browse one post, > you can get the most relevant posts list. I took a quick look of some > wordpress's relate

[google-appengine] retrieve instance name

2008-12-27 Thread Hans-Peter
Can anyone tell me how to retrieve the name of an instance? puzzle = models.Puzzle( key_name='my_new_puzzle' ) puzzle.title = 'My puzzle' puzzle.put() This works fine, i see the ID/Name in the data viewer then I try to retrieve the name puzzle.id_or_name() I get the error: AttributeError: 'P

[google-appengine] Good for a background task?

2008-12-27 Thread agartland
Do you think Google App Engine is suitable for an idea I have about a program that will crawl around on the web and gather data for me for a project? The examples that I have found all seem to involve apps in which the program is responding to the user. I would like to use a google app as a sort

[google-appengine] HELP A GQL exception "AttributeError: 'GqlQuery' object has no attribute 'has_key'"

2008-12-27 Thread Pikaurd
Hi guys. I got a error "AttributeError: 'GqlQuery' object has no attribute 'has_key'" when I executing the GQL and my statement is "SELECT * FROM Lists ORDER BY date LIMIT 10". At first I think the statement have some problem then I changed to .all() but the same error. --~--~-~--~~-

[google-appengine] how best to represent a directed graph w/ 25K nodes? (for path planning)

2008-12-27 Thread Amar Pai
Hi, I have a route planning webapp, written in Python, that uses Djikstra's algorithm to find the shortest path between two nodes in a directed graph. I want to port this to AppEngine, but I'm not sure how to represent the graph. Right now I'm using a dict of dict, G[pt] [pt] -> (edge data) whe

[google-appengine] application wont write to file system. am i reading this right

2008-12-27 Thread gom...@gmail.com
what do they mean by the application can not write data to the file system. i have an email application written in c# and in order for it to be sent it must temporarily post to which ever server its running on in order to relay to its client like so strFileName = Path.GetFileName(FileUpload1.Pos

[google-appengine] Re: Forwarding Request

2008-12-27 Thread Mir Nazim
On Fri, Dec 26, 2008 at 4:56 PM, ffelgenh wrote: > > Hi, > > is it possible to forward a request to some external URL from within > my Google App Engine application? What do you exactly mean by forwarding the request. Do you mean that you want to forward the request object that you get inside a

[google-appengine] decoding post data

2008-12-27 Thread samba
Hi, How can I decode post data that contains spaces ?, Right now I am seeing %20 in the place of spaces. Is there a builtin mehtod to do this ? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Google App Engine" grou

[google-appengine] Re: HELP A GQL exception "AttributeError: 'GqlQuery' object has no attribute 'has_key'"

2008-12-27 Thread Alexander Kojevnikov
Could you post here your code (both the querying part and the model definition)? On Dec 28, 2:59 am, Pikaurd wrote: > Hi guys. I got a error "AttributeError: 'GqlQuery' object has no > attribute 'has_key'" when I executing the GQL and my statement is > "SELECT * FROM Lists ORDER BY date LIMIT 10

[google-appengine] Re: retrieve instance name

2008-12-27 Thread Alexander Kojevnikov
> Can anyone tell me how to retrieve the name of an instance? > > puzzle = models.Puzzle( key_name='my_new_puzzle' ) > puzzle.title = 'My puzzle' > puzzle.put() > > This works fine, i see the ID/Name in the data viewer > > then I try to retrieve the name > > puzzle.id_or_name() > > I get the error

[google-appengine] Re: Good for a background task?

2008-12-27 Thread Alexander Kojevnikov
App Engine cannot spawn threads or start processes. It also has zero built-in support for background processing, though Google is going to implement something in the future. There are a few workarounds, search this group for "background". Cheers, Alex -- www.muspy.com On Dec 28, 2:22 am, agartl

[google-appengine] Re: application wont write to file system. am i reading this right

2008-12-27 Thread Alexander Kojevnikov
You are reading it right, apps are not allowed to write to the file system. To add attachments you don't need to create temporary files, the Mail API accepts in-memory data: http://code.google.com/appengine/docs/mail/attachments.html Cheers, Alex -- www.muspy.com On Dec 28, 9:22 am, "gom...@gma

[google-appengine] Re: decoding post data

2008-12-27 Thread Barry Hunter
import urllib ... url = urllib.unquote(param) 2008/12/27 samba : > > Hi, > > How can I decode post data that contains spaces ?, Right now I am > seeing %20 in the place of spaces. Is there a builtin mehtod to do > this ? > > > -- Barry - www.nearby.org.uk - www.geograph.org.uk - --~--~--

[google-appengine] Re: Error in bulkupload with DateTimeProperty

2008-12-27 Thread djidjadji
You have to convert the string to datetime.datetime first ('LastUsed', lambda x: datetime.datetime.strptime(x, '%Y-%m-%d')), adjust the format string according to your date-time string 2008/12/27 RAJ : > > Hi, > > I am trying to upload a csv file in datastore, and I think the > following error is

[google-appengine] Re: how best to represent a directed graph w/ 25K nodes? (for path planning)

2008-12-27 Thread David Symonds
On Sat, Dec 27, 2008 at 5:16 AM, Amar Pai wrote: > I have a route planning webapp, written in Python, that uses > Djikstra's algorithm to find the shortest path between two nodes in a > directed graph. I want to port this to AppEngine, but I'm not sure > how to represent the graph. Right now I

[google-appengine] Re: how best to represent a directed graph w/ 25K nodes? (for path planning)

2008-12-27 Thread Robin B
Using Djikstra's shortest path algorithm, you can compute the shortest paths between all nodes in the same runtime as computing the path between any 2 nodes, so storing then querying the precomputed paths would be a good approach as mentioned above. > Since there are no files in AppEngine, my fir

[google-appengine] Re: HELP A GQL exception "AttributeError: 'GqlQuery' object has no attribute 'has_key'"

2008-12-27 Thread Pikaurd Chen
There is my code. Thx # --> model define class Lists(db.Model): type = db.IntegerProperty() money = db.IntegerProperty() remark = db.StringProperty(multiline=True) date = db.DateTimeProperty(auto_now_add=True) #TestHandler define class TestHandler(webapp.RequestHandler): def get(se

[google-appengine] Re: HELP A GQL exception "AttributeError: 'GqlQuery' object has no attribute 'has_key'"

2008-12-27 Thread Alexander Kojevnikov
You need to fetch() your entities, you cannot just pass the query object to the template. Also, template.render() expects a dictionary as its second argument. Try this code: def get(self): query = db.GqlQuery("SELECT * FROM Lists ORDER BY date") lists = query.fetch(10) path = os.p

[google-appengine] Importing data into DATASTORE

2008-12-27 Thread aravind
Hi, Is it possible to load data into my datastore from a spreadsheet (google spreadsheet or an excel file) or a text file? If so, how do I go about it? Pls help!!! Aravind --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google G

[google-appengine] Bug report: On "My Applications" panel, I can't access the app whose name only contains digital chars.

2008-12-27 Thread Max
I created one app named "000", but I can't access it by click its name on On "My Applications" panel. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to go

[google-appengine] Re: Importing data into DATASTORE

2008-12-27 Thread Alexander Kojevnikov
> Is it possible to load data into my datastore from a spreadsheet > (google spreadsheet or an excel file) or a text file? > You can use the bulk data uploader: http://code.google.com/appengine/articles/bulkload.html Cheers, Alex -- www.muspy.com --~--~-~--~~~---~--~--