[google-appengine] Re: Access entity properties dynamically (like introspection)

2008-12-28 Thread boson
Thanks. I think that turned out to be more of a Python question than a GAE question. I'm using getattr(obj, 'foo_%d' % x), and it seems to be working fine. On Dec 28, 1:36 pm, Alexander Kojevnikov wrote: > You should not rely on the implementation details, they can change and > break your code

[google-appengine] Re: Using other python files with my app; importing

2008-12-28 Thread Mir Nazim
On Mon, Dec 29, 2008 at 3:48 AM, MajorProgamming wrote: > > This may be more of a general python question, but what's the best way > of using many different .py files and importing one into another. For > example, suppose I want to have one main.py and have a separate file > that contains like 15

[google-appengine] Expend the user API?

2008-12-28 Thread lookon
I wish in the next sdk, the user API can be expended. So we can get the friends of a user using the user api. Another request is that, the friendconnect should be compatible with GAE, so user need not to login twice. --~--~-~--~~~---~--~~ You received this message

[google-appengine] Re: Googe App Engine and Friend Connect...

2008-12-28 Thread benzrad
i also need to python code to judge the url to redircct respectively. u know, my domain blocked in China, whose surveillance now absolutely banned my domain, be21zh.org. i had some appspot sites bonded with custom domain under be21zh.org, like forum.be21zh.org , guestbook.be21zh.ort , etc. while g

[google-appengine] Re: Googe App Engine and Friend Connect...

2008-12-28 Thread benzrad
dear sir, i also want to add google friend connect onto my GAE, but where directory should i place the 2 file google asked for uploading, ie., canvas.html&rpc_relay.html ? i place them on the root folder of my app, also place them in the static folder with other html files, but neither working, ie

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

2008-12-28 Thread Amar Pai
So if I shard my graph into 3 parts, my main class can store them as class variables and they'll persist across requests? That would be great. But will I run into quota problems holding 3M data in memory? (Assuming low overhead otherwise, and only 100ish requests per day) Also, if I did it that

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

2008-12-28 Thread nickmilon
Well ... not real answers from me to your question yet but nice application you made regards Nick On Dec 29, 1:47 am, Nash-t wrote: > I should add that there will be a confirmation email sent in both use > cases that sends a key in a url. The user will then click that link to > actually

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

2008-12-28 Thread Amar Pai
There are 312 487 500 potential paths (25K choose 2) and edge weights are variable-- the cost function is determined by user-configurable multipliers. So precomputing all paths in advance isn't feasible, unless I'm misunderstanding what you mean. On Dec 27, 5:03 pm, "David Symonds" wrote: > On

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

2008-12-28 Thread nickmilon
Well ... not real answers from me to your question yet but nice application you made regards Nick On Dec 29, 1:47 am, Nash-t wrote: > I should add that there will be a confirmation email sent in both use > cases that sends a key in a url. The user will then click that link to > actually

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

2008-12-28 Thread nickmilon
Well ... not real answers from me to your question yet but nice application you made regards Nick On Dec 29, 1:47 am, Nash-t wrote: > I should add that there will be a confirmation email sent in both use > cases that sends a key in a url. The user will then click that link to > actually

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

2008-12-28 Thread Nash-t
I should add that there will be a confirmation email sent in both use cases that sends a key in a url. The user will then click that link to actually complete the transaction (like user registration systems). I'm thinking of making this a feature request. "GOOG: the application server" has severa

[google-appengine] Iterating through XML with django templates

2008-12-28 Thread Martynas Brijunas
Hi, I have run into difficulties when trying to access certain parts of Picasa's XML from django templates. For example, a list of tags for a photograph can be found under a "media:keywords" tag. However, when I try to parse something like {{ photo.media:group.media:keywords }} in a template, I a

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

2008-12-28 Thread Ben Bishop
Google search digs up lots of tutorials, tips and tricks - feed parsing and display is pretty popular. Here's a tutorial that gently guides you through getting started by building a feed parser that uses Django templates. (If you're hoping for hardcore Hollywood hacker GUIs, you'll be slightly di

[google-appengine] Re: How to Backup Datastore

2008-12-28 Thread Aral Balkan
Another solution, that I just released over the holidays, is Google App Engine Backup and Restore (Gaebar). The screencast, links to repositories, etc., are in the blog post: http://aralbalkan.com/1784 Bug reports, comments, suggestions, and patches are welcome! :) Aral On Nov 25, 12:35 pm, "k

[google-appengine] How do you debug?

2008-12-28 Thread Chen Harel
Does anyone here have a simple way to breakpoint your code? I saw a tutorial for PyDev in Eclipse, but what about simpler IDE such as ActivePython? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Google App Engine"

[google-appengine] Re: AppEngine GET response headers

2008-12-28 Thread Chen Harel
10x ! It worked :) On Dec 29, 12:33 am, Alexander Kojevnikov wrote: > You should use the response object: > >   def get(self): >     self.response.headers['Content-Type'] = 'text/plain' >     self.response.out.write('your json') > > Cheers, > Alex > --www.muspy.com > > On Dec 29, 9:19 am, Chen H

[google-appengine] Re: AppEngine GET response headers

2008-12-28 Thread Alexander Kojevnikov
You should use the response object: def get(self): self.response.headers['Content-Type'] = 'text/plain' self.response.out.write('your json') Cheers, Alex -- www.muspy.com On Dec 29, 9:19 am, Chen Harel wrote: > I'm trying to create a data table in an appengine, and send it back to >

[google-appengine] Re: Using other python files with my app; importing

2008-12-28 Thread Alexander Kojevnikov
I suggest you to skim through the part of the tutorial that explains modules and packages: http://www.python.org/doc/2.5.2/tut/node8.html On Dec 29, 9:18 am, MajorProgamming wrote: > This may be more of a general python question, but what's the best way > of using many different .py files and im

[google-appengine] AppEngine GET response headers

2008-12-28 Thread Chen Harel
I'm trying to create a data table in an appengine, and send it back to a user. The user requests the data table using GET method, and I use class MainPage(webapp.RequestHandler): # This function is invoked when a user sends a get request def get(self): self.response.out.write("...") To g

[google-appengine] Using other python files with my app; importing

2008-12-28 Thread MajorProgamming
This may be more of a general python question, but what's the best way of using many different .py files and importing one into another. For example, suppose I want to have one main.py and have a separate file that contains like 15 functions which are needed in main.py. First of all, what do I ha

[google-appengine] Re: Memcache Usage with Timeouts - Question

2008-12-28 Thread MajorProgamming
Thanks. Nice workaround! On Dec 28, 4:50 pm, "Barry Hunter" wrote: > the 'time' when you add memcache value can actully be a timestamp. > When you first add calculate 'expire time' then either store in the > value, or in a another memcache item. That way when you replace it you > just read the c

[google-appengine] Re: Memcache Usage with Timeouts - Question

2008-12-28 Thread Barry Hunter
the 'time' when you add memcache value can actully be a timestamp. When you first add calculate 'expire time' then either store in the value, or in a another memcache item. That way when you replace it you just read the current expire timestamp, and use it again. 2008/12/28 MajorProgamming : >

[google-appengine] Re: Access entity properties dynamically (like introspection)

2008-12-28 Thread Alexander Kojevnikov
You should not rely on the implementation details, they can change and break your code. The Model class has a properties() method: http://code.google.com/appengine/docs/datastore/modelclass.html#Model_properties To access the values of the properties you can use this code: for prop in obj.prope

[google-appengine] Re: Money sum formating

2008-12-28 Thread Alexander Kojevnikov
> Forget currency > > How I inset comma in: > > {{ total_in|floatformat:2 }} > > to get : 32,525.75 for example > You can use this filter: @register.filter() def comma(value): locale.setlocale(locale.LC_ALL, '') return locale.format('%.2f', 1234.5678, True) --~--~-~--~~--

[google-appengine] Re: Money sum formating

2008-12-28 Thread Alexander Kojevnikov
Which version of Django do you use? Could you also post the full stack trace? On Dec 29, 5:24 am, Shay Ben Dov wrote: > Hi, > > I tried what you suggested and this is what I got: > > : Environment variable > DJANGO_SETTINGS_MODULE is undefined. >       args = ('Environment variable DJANGO_SETTIN

[google-appengine] Access entity properties dynamically (like introspection)

2008-12-28 Thread boson
Say I have: class MyClass(db.Model): foo1 = db.IntegerProperty() foo2 = db.IntegerProperty() foo3 = db.IntegerProperty() obj = MyClass(foo1=100, foo2=200, foo3=300) I want to loop over foo values. I found that I can do: for x in [1, 2, 3]: print obj.__dict__['_foo%d' % x] Is this bad

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

2008-12-28 Thread Alexander Kojevnikov
> > your suggestions to override methods worked a treat. Overriding at the > > Model level suits me very well as it gives me flexibility. One final > > question (I hope): what is the difference in overriding the > > __unicode__ and __str__ methods? > > Unless you're actually dealing with Unicode t

[google-appengine] Memcache Usage with Timeouts - Question

2008-12-28 Thread MajorProgamming
I have an app where I want to set a memcache for 1 hour expiration, and then update it while keeping the same timeout (i.e. when I update it I don't want the 1-hour to start over, I just want the value to change, while keeping the timeout the same as b4). How can I do this? --~--~-~--~

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

2008-12-28 Thread Geoffrey Spear
Did you also notice that applications that aren't written in Python won't run at all? The filesystem is the least of your problems here. On Dec 27, 5:22 pm, "gom...@gmail.com" wrote: > what do they mean by the application can not write data to the file > system. i have an email application writ

[google-appengine] Re: Money sum formating

2008-12-28 Thread Shay Ben Dov
Hi, Forget currency How I inset comma in: {{ total_in|floatformat:2 }} to get : 32,525.75 for example Thanks, Shay Ben Dov On Dec 26, 8:45 am, Alexander Kojevnikov wrote: > Shay, you can try this code: > > import locale > from django import template > > register = template.Library() > > @

[google-appengine] Re: Money sum formating

2008-12-28 Thread Shay Ben Dov
Hi, I tried what you suggested and this is what I got: : Environment variable DJANGO_SETTINGS_MODULE is undefined. args = ('Environment variable DJANGO_SETTINGS_MODULE is undefined.',) errno = None filename = None message = 'Environment variable DJANGO_SETTINGS_MODULE is

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

2008-12-28 Thread David Symonds
On Mon, Dec 29, 2008 at 12:24 AM, Martynas Brijunas wrote: >> 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 label_from_instance implementation. Oops. I read Alex's email too quickly. He sug

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

2008-12-28 Thread TLH
Is that the same as ... class NewTest(Test): pass ... ? On Dec 27, 12:20 pm, yejun wrote: > NewTest=type('NewTest',(Test,),{}) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Google App Engine" group. To pos

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

2008-12-28 Thread Martynas Brijunas
Hi Alex/David, > Alternatively, you can override the __unicode__ method of your model: > >class SizeOption(db.Model): >code = db.StringProperty(required = True) >html = db.StringProperty(required = True, multiline = True) > >def __unicode__(self): >return self.code > > You ca

[google-appengine] Re: 3 feature requests

2008-12-28 Thread Mattias Johansson
The Django sitemaps framework does not work on GAE. Star the issue here: http://code.google.com/p/google-app-engine-django/issues/detail?id=102&q=sitemaps On 11 Dec, 10:51, niklasr wrote: > The form preview framework works with gae and the django request > handler. Validation rules like servers

[google-appengine] Re: A bug? On "My Applications" panel, I can't visit the app whose name only contains number chars.

2008-12-28 Thread Max
Not deployed, and CAN NOT. I got this while using update command : - Initiating update. 2008-12-28 16:49:22,780 ERROR appcfg.py:1128 An unexpected error occurred. Abort ing. Error 403: --- begin server output --- You do not have permission to modify thi

[google-appengine] A bug? On "My Applications" panel, I can't visit the app whose name only contains number chars.

2008-12-28 Thread Max
I created one app named "000", but I can't access it by click its link on "My Applications" panel at http://appengine.google.com/ The link on the app name was "http://appengine.google.com/dashboard?";. It seems the part "&app_id=000" missed. --~--~-~--~~~---~--~~ Y

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

2008-12-28 Thread Pikaurd Chen
You sure deployed? On Dec 28, 2008, at 11:07 AM, Max wrote: > > 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 G