Re: [web2py] Re: book "bugs"

2011-03-24 Thread Martin Weissenboeck
Trying http://web2py.com/book/ I got: Internal errorTicket issued: book/81.223.149.226.2011-03-25.06-02-53.5316f94b-b033-4197-a3ab-5e27e7d9edc2 2011/3/25

Re: [web2py] Re: book "bugs"

2011-03-24 Thread Marco Mansilla
El Thu, 24 Mar 2011 20:32:03 -0700 (PDT) Kevin Ivarsen escribió: > Good catch. I've made the edit. > > Cheers, > Kevin is there any bug on the book site?, i get an invalid request and ticket on http://web2py.com/book/ Marco.

[web2py] Re: squeeze + Apache2 = lots of RAM

2011-03-24 Thread LightOfMooN
it redirects me =\ On 25 мар, 08:02, pbreit wrote: > I posted a Fabirc script for installing > nginx/uwsgi:https://groups.google.com/d/msg/web2py/kd_A86Qwz6w/Fcv5g-sp98AJ > > I've been using it in development but not in production yet.

[web2py] Re: help with using rich text file.

2011-03-24 Thread pbreit
Well, I'm relatively new to Python and don't know all the ins and outs. It was more of a guess. Are you really trying to insert raw numbers? An RTF doc is text after all.

[web2py] Re: help with using rich text file.

2011-03-24 Thread andre . dwyer89
So in other words I can't append raw integer data, I have to append values of type "string". Sent from my BlackBerry® device from Digicel

[web2py] Re: auth_user field default to other auth_user field?

2011-03-24 Thread pbreit
Oh, shoot, I figured that might be the answer but only had "register_onaccept" in my list. I ended up writing a function since it seems assignments in lambdas are difficult. I tried setattr() and a nested function to no avail. Any ideas? def set_paypal_email(form): form.vars.paypal_email=fo

[web2py] Re: help with using rich text file.

2011-03-24 Thread pbreit
You probably need to do: section.append('500')

[web2py] Re: book "bugs"

2011-03-24 Thread Kevin Ivarsen
Good catch. I've made the edit. Cheers, Kevin

[web2py] Unpack a MIME message (Gmail)

2011-03-24 Thread Ahmed Bani
Hello everyone, I have found enough resources on how to send messages from my web2py application. Now, I need some information that could help me to successfully unpack a MIME message and parse the results from Gmail.com. Any ideas or suggestion are welcome. Thanks, Bani

[web2py] Re: help with using rich text file.

2011-03-24 Thread Andre Dwyer
this is the code i have in web2py def makertf(): import gluon.contrib.pyrtf as q doc=q.Document() section=q.Section() doc.Sections.append(section) section.append(500) section.append(200) response.headers['Content-Type']='text/rtf' r

[web2py] Re: auth_user field default to other auth_user field?

2011-03-24 Thread Massimo Di Pierro
auth.settings.register_onvalidation=lambda form: manipulate_form_before_insert(form) On Mar 24, 2011, at 6:06 PM, pbreit wrote: > OK, I see. Is there some way to intercept the user/register form.accepts to > set that default?

[web2py] Re: help with using rich text file.

2011-03-24 Thread pbreit
Should be. Can you show some code?

[web2py] help with using rich text file.

2011-03-24 Thread Andre Dwyer
can numbers be written to rtf files. web2py constantly returns a ticket each time i try

[web2py] Re: squeeze + Apache2 = lots of RAM

2011-03-24 Thread pbreit
I posted a Fabirc script for installing nginx/uwsgi: https://groups.google.com/d/msg/web2py/kd_A86Qwz6w/Fcv5g-sp98AJ I've been using it in development but not in production yet.

[web2py] Re: book "bugs"

2011-03-24 Thread niknok
Also in chapter 7, SQLFORM.factory. Missing ":" in function "form_from_factory()" example. should read: "form_from_factory():" In epydoc, INPUT component. There are two examples for "radio" types. I suppose the other one is meant for the "submit" type, which isn't listed at all? On Mar 18, 8:

[web2py] Re: squeeze + Apache2 = lots of RAM

2011-03-24 Thread VP
I definitely agree that there should be a setup guide / script for nginx/wsgi for web2py. That said, I'm not giving up on Apache yet. I think I found out what the culprit to this high usage of RAM for Debian squeeze. Short answer. I think this will fix it: sudo apt-get install apache2-mpm-pref

Re: [web2py] Does this seems familiar?

2011-03-24 Thread Marco Mansilla
Déjà vu! > http://www.microsoft.com/web/post/web-development-101-using-webmatrix > > layout, database, template language, helpers, intellisense, ... > > I have seen all this before... but where?. -- /* Marco Antonio Mansilla Gut

Re: [web2py] Re: squeeze + Apache2 = lots of RAM

2011-03-24 Thread Luis Díaz
I'd like to try the suggestion of Mr. massimo but I have the time to learn on the fly I hope the collaboration of someone on the list I'm starting to develop systems in several vps and I face this problem of memory. cherokke could also be a good approximation .. Whether this also in a script .sh

[web2py] Re: IS_INT_IN_RANGE Behavior in Database Example

2011-03-24 Thread DenesL
On Mar 23, 12:29 pm, Massimo Di Pierro wrote: > Thins constraint > > >   db.purchases.quantity.requires=IS_INT_IN_RANGE(0,10) > > is enforced in > > form=crud.create(db.purchases) > form=crud.update(db.purchases,record) > form=SQLFORM(db.purchases) > form=SQLFORM.factory(...,db.purchases.quantit

[web2py] Does this seems familiar?

2011-03-24 Thread DenesL
http://www.microsoft.com/web/post/web-development-101-using-webmatrix layout, database, template language, helpers, intellisense, ... I have seen all this before... but where?.

[web2py] Re: onmouseover

2011-03-24 Thread DenesL
On Mar 24, 4:41 pm, Kenneth Lundström wrote: >  > I am guessing you mean a Python variable > > Right > >  > so maybe: >  > _onmouseover="displayText('info', {{=watchers[check_date]}} )", > > But I m building the table in the controller so I guess I can t use > {{=     }}   ? In that case: _onmo

Re: [web2py] Re: File Upload and save to DB

2011-03-24 Thread Ismael Alejandro
Hi again, working with the original section, now I have this: - On a CLIENT computer, I generate the INI file with this structure: [Room] name = room1 color = red size = big - I send it by FTP to the computer where web2py is running - I have this script to parse and process the INI files on th

Re: [web2py] Re: new URL router use cases

2011-03-24 Thread pbreit
I think I'm in agreement. App-specific routing should be controlled at the app level. I was just saying that it might be tricky to figure out how to set up the default file structure and routes to both work and handle future updates.

Re: [web2py] Stopping Dev server

2011-03-24 Thread pbreit
I guess it is tricky. I was concerned about my crons causing 5 python processes to start every time I restarted web2py. The answer is probably not that simple. When you're in dev mode and only using Python with web2py, there might be a solution. Otherwise, I suppose you have to be careful about

Re: [web2py] Stopping Dev server

2011-03-24 Thread Marco Mansilla
I've been wondering about it too, and for the same reasons, wouldn't be possible to set a -reload parameter on development mode? or just a mode that assumes it by itself, develmode or something like that. Marco > Hi, > > Just wondering if the admin application could off the option to > restart

[web2py] Re: Converting legacy MySQL databases to web2py DAL

2011-03-24 Thread fib
Hi all OK I got it to work I found a MySQLdb for python 2.5 .exe on sourceforge http://sourceforge.net/projects/mysql-python/files%2Fmysql-python%2F1.2.2/ then the rest I got sorted through the command line apologies for idiocy thank you for all your help it is much appreciated On Mar 24, 8:03 

Re: [web2py] Re: new URL router use cases

2011-03-24 Thread Martín Mulone
Sorry perhaps I don't express myself correctly, I'm not saying this is a bug or I can't do with the current way. I'm only saying that I think better if there are something like that in app level. It's an idea. Main routes.py to control things up to the application, and the rest by the application.

Re: [web2py] Re: Class in the session

2011-03-24 Thread Rui Gomes
I guys, The "order = cache.ram(session.name, lambda:Order(), 3600)", did work and do exactly what I want thanks for the tips, the part of not holding the data is no problem, if I want it to be persistent data I will at some point insert in to the DB. Regards Rui Gomes On Thu, Mar 24, 2011 at 3:5

[web2py] Stopping Dev server

2011-03-24 Thread David Warnock
Hi, Just wondering if the admin application could off the option to restart the development webserver. When running in development mode using "python2.5 web2py.py" there are a few times when the server needs to be stopped or restarted (install upgrade, adding routes.py). I wondered whether it wo

[web2py] Re: auth_user field default to other auth_user field?

2011-03-24 Thread pbreit
OK, I see. Is there some way to intercept the user/register form.accepts to set that default?

[web2py] Re: Class in the session

2011-03-24 Thread Massimo Di Pierro
I have not tested is but I suspect cache.disk add some 10-20ms to every request. Only use it if to cache long queries, not cache pages. cache.ram is the way to go for many other cases even if you loose it upon restart. On Mar 24, 12:57 pm, Michele Comitini wrote: > I would use cache.disk otherwis

[web2py] Re: squeeze + Apache2 = lots of RAM

2011-03-24 Thread Massimo Di Pierro
web2py has a script to run with tornado. This video shows how to install and run it: http://vimeo.com/21185623 Mind there is no benefit compared with the built-in rocket. I have seend web2py run with nginx+uwsgi and I stringly recommend it. Somebody should make a setup-nginx-wsgi.sh Massimo

Re: [web2py] Re: squeeze + Apache2 = lots of RAM

2011-03-24 Thread Vasile Ermicioi
why don't you use nginx or cherokee with uwsgi ? they both consume much less ram than apache

Re: [web2py] Re: squeeze + Apache2 = lots of RAM

2011-03-24 Thread Luis Díaz
will try next week to conduct stress tests. someone has a script-style "setup-web2py.sh? allow me to implement a tornado server and allows restart in case of failure Díaz Luis http://www.facebook.com/diazluis2007 User Linux 532223 progjuegos.com TSU Analisis de Sistemas Universidad de Carabobo Fac

[web2py] Re: auth_user field default to other auth_user field?

2011-03-24 Thread Massimo Di Pierro
default does a take a lambda but one without arguments, because the info is used before the form is submitted so there is no data (r). On Mar 24, 2011, at 5:30 PM, pbreit wrote: > I don't think that's quite the behavior I'm looking for. I want it to 1) > default.paypal_email=email upon regist

[web2py] Re: auth_user field default to other auth_user field?

2011-03-24 Thread pbreit
I don't think that's quite the behavior I'm looking for. I want it to 1) default.paypal_email=email upon registration and 2) both email and paypal_email editable independently in Edit Profile. So this would be perfect: Field('paypal_email', length=128, default=lambda r: r.email)) But

Re: [web2py] Re: new URL router use cases

2011-03-24 Thread pbreit
+1 for a move towards routes default "on" and primarily controlled at the app level. But I do recognize there is an issue about what file should come in the main distribution and how to avoid it being overwritten with updates. The default files could duplicate the current default functionality f

[web2py] Re: squeeze + Apache2 = lots of RAM

2011-03-24 Thread VP
You can stop and restart apache to confirm that it takes that much RAM. If you do a stress test, you'll probably see that it will eat all your RAM. On Mar 24, 3:55 pm, Luis Díaz wrote: > I just implement a VPS with "debian 6 / 64bit" > using the script setup-web2py.sh > > VPS administrator in me

[web2py] Re: I goofed

2011-03-24 Thread pbreit
I'm sure the book format is great but if you are at your computer, I would suggest using the online version: http://web2py.com/book

[web2py] Re: Class in the session

2011-03-24 Thread Jose
On 24 mar, 14:57, Michele Comitini wrote: > I would use cache.disk otherwise on restart everything would be lost > Basically the concept is the same. Jose

Re: [web2py] squeeze + Apache2 = lots of RAM

2011-03-24 Thread Luis Díaz
I just implement a VPS with "debian 6 / 64bit" using the script setup-web2py.sh VPS administrator in me Proxmox typical samples consumption of 669 ram and without using the application but from the console I see the following: http://tinypaste.com/fbb29 the system has allocated a total of 1GB RA

Re: [web2py] Re: onmouseover

2011-03-24 Thread Kenneth Lundström
> I am guessing you mean a Python variable Right > so maybe: > _onmouseover="displayText('info', {{=watchers[check_date]}} )", But I´m building the table in the controller so I guess I can´t use {{= }} ? Kenneth It is the watchers[check_date] that holds the text that should be sent

[web2py] I goofed

2011-03-24 Thread Hal Smith
Working on the view file this morning, I noticed my error. I had copied the line numbers into the code when I copied the code from the manual. Today I removed those, and added the session counter code. Everything works fine.

[web2py] Re: onmouseover

2011-03-24 Thread DenesL
On Mar 24, 4:55 am, Kenneth Lundström wrote: > I got the onmouseover to work but how do I send text to the javascript > from a variable. I have this code I am guessing you mean a Python variable >   TD(P(day, _class="text_black"), _class="red", > _onmouseover="displayText('info', watchers[chec

[web2py] Re: Converting legacy MySQL databases to web2py DAL

2011-03-24 Thread fib
Oh I think "reply to author" was an email - I think I replied but it is not showing here?

Re: [web2py] Re: Scaffolding app with Twitter OAuth1.0a auth

2011-03-24 Thread Tito Garrido
Hi Albert, Were you able to import it on webfaction? If yes, how did you do that? Regards, Tito On Mon, Sep 6, 2010 at 7:50 AM, Albert Abril wrote: > Hi Michelle. > > Yes, As you said, I defined it in the db.py. > > Now, I'm having an error importing oauth2. > I installed python-oauth2 in web

Re: [web2py] Re: Converting legacy MySQL databases to web2py DAL

2011-03-24 Thread Vasile Ermicioi
try to implement it with pymysql which is shipped with web2py (gluon.contrib.pymysql)

Re: [web2py] Re: new URL router use cases

2011-03-24 Thread Tom Atkins
Thanks Anthony - you're right and I do know this - just wrote the wrong thing in my previous post - I meant to say 'change to pattern-based'... make me wonder what other stupid mistakes I'm making... but double checked and I think I have everything correct and as suggested by Massimo. On 24 March

Re: [web2py] Re: 1.94.5 auth pb form won't submit

2011-03-24 Thread Richard Vézina
Thanks! Removing "required=True" solved the problem... Richard On Tue, Mar 22, 2011 at 2:38 PM, Massimo Di Pierro < massimo.dipie...@gmail.com> wrote: > This should never have worked: > > Field('seizure_date','date', >writable=False, >... >required=True >), > > t

Re: [web2py] Re: new URL router use cases

2011-03-24 Thread Anthony
Tom, you cannot mix usage of the parameter-based and pattern-based routing systems, even if one is in the global routes.py and one is in an app-specific routes.py. You have to pick one system or the other, for now anyway. Anthony On Thursday, March 24, 2011 1:59:33 PM UTC-4, Tom A wrote: > T

Re: [web2py] Re: new URL router use cases

2011-03-24 Thread Tom Atkins
Thanks for this suggestion Massimo - it's the closest to what I'm looking for. I've tried to get it to work but no joy. I've changed my global routes.py to use parameter based routing sand put the first part of your code in the application specific routes.py. I've then put the 2nd part of your c

Re: [web2py] Re: Class in the session

2011-03-24 Thread Michele Comitini
I would use cache.disk otherwise on restart everything would be lost 2011/3/24 Jose : >> You should use cache. >> >> order = cache.ram('order', lambda:Order(), 3600) > > order = cache.ram(session.name, lambda:Order(), 3600) > > Jose

[web2py] Re: Class in the session

2011-03-24 Thread Jose
> You should use cache. > > order = cache.ram('order', lambda:Order(), 3600) order = cache.ram(session.name, lambda:Order(), 3600) Jose

[web2py] Re: Class in the session

2011-03-24 Thread Jose
Sorry, this is global, not per session. Could be used by renaming the object in each session. order = cache.ram(session.name, lambda:Order(), 3600) Jose

Re: [web2py] Re: new URL router use cases

2011-03-24 Thread Jonathan Lundell
On Mar 24, 2011, at 10:35 AM, Anthony wrote: > On Thursday, March 24, 2011 12:51:56 PM UTC-4, Martin.Mulone wrote: > Yes but not in the application folder. The importance is to be distributed > with the application. I think you two might be talking at cross purposes here. It goes in applications

[web2py] Re: Class in the session

2011-03-24 Thread Jose
On 24 mar, 11:04, NewBeen wrote: > Hello guys, > > I have this class in a model, > > Class Order: > >     def __init__(self): >         self.basket={"product":{},"quantity":{}} > >    def addProduct(self, Item): >        self.basket["product"]["name"]=item["name"] > > session.order=Order() > > S

[web2py] Re: Converting legacy MySQL databases to web2py DAL

2011-03-24 Thread Kevin Ivarsen
The extract_mysql_models.py script runs at the command line - either from cmd.exe in Windows or a Terminal window in Mac / Linux. Which operating system are you running? I can try to walk you through the steps. Also, I don't believe MySQLdb is included with web2py by default, but it is easy to

[web2py] New framework: whirlwind

2011-03-24 Thread pbreit
http://wiredset.com/2011/03/23/introducing-whirlwind-the-realtime-web-framework/ Tornado + mako + mongodb

Re: [web2py] Re: new URL router use cases

2011-03-24 Thread Anthony
On Thursday, March 24, 2011 12:51:56 PM UTC-4, Martin.Mulone wrote: > > Yes but not in the application folder. The importance is to be distributed > with the application. With both systesms, you can put a routes.py file in the application folder, but at least with the older system, for that t

Re: [web2py] Re: new URL router use cases

2011-03-24 Thread Jonathan Lundell
On Mar 24, 2011, at 9:57 AM, Martín Mulone wrote: > For example I have a blog application with this url > > http://www.mysite.com/blog/default/post/2010/10/10/my-article > > I can short to this: > > http://www.mysite.com/blog/2010/10/10/my-article > > with this one route: > > (r'.*:/blog/(?P(1

[web2py] Re: Running the web2py mini-fb clone demo (additional info and some questions)

2011-03-24 Thread Arbie Samong
This got rid of the errors. Thanks Massimo. The only thing I added was a try-except block on search() when no people were found. The simpler version of the query also restricted the search somehow (had to search first name and last name with the right capitalization) but I guess that's the trad

Re: [web2py] Re: new URL router use cases

2011-03-24 Thread Martín Mulone
For example I have a blog application with this url http://www.mysite.com/blog/default/post/2010/10/10/my-article I can short to this: http://www.mysite.com/blog/2010/10/10/my-article with this one route: (r'.*:/blog/(?P(19|20)\d\d[- /.](0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01]).*)$',r'/blo

Re: [web2py] Re: new URL router use cases

2011-03-24 Thread Tom Atkins
The problem for me is not being able to mix the new parameter-based routing with the pattern-based system (my regex skills are not good enough to make the patten system do what I want) . Is it possible to have parameter system in the global routes.py and then pattern system in the app-specific

Re: [web2py] Re: new URL router use cases

2011-03-24 Thread Martín Mulone
Yes but not in the application folder. The importance is to be distributed with the application. 2011/3/24 Anthony > I believe this is already possible, no? > > The book describes app-specific routing for the old system: > http://web2py.com/book/default/chapter/04#Pattern-Based-System > > And f

Re: [web2py] Re: Class in the session

2011-03-24 Thread Jonathan Lundell
On Mar 24, 2011, at 9:39 AM, Rui Gomes wrote: > Regarding storing the class in the session is not a problem that work fine > for me(need to be careful some things can't be pickel), the problem is > re-write it at each call, > > I already try something similar to > > order = session.order or Or

Re: [web2py] Re: Class in the session

2011-03-24 Thread Rui Gomes
Regarding storing the class in the session is not a problem that work fine for me(need to be careful some things can't be pickel), the problem is re-write it at each call, I already try something similar to order = session.order or Order() I did, if not isinstance("session.order",Order): se

[web2py] Re: Running the web2py mini-fb clone demo (additional info and some questions)

2011-03-24 Thread Massimo Di Pierro
Could be a mistake in the packaging makefile. Will fix and repost tonight. On Mar 24, 9:19 am, Anthony wrote: > On Thursday, March 24, 2011 8:22:14 AM UTC-4, Arbie Samong wrote: > > > thanks for the reply, Anthony. The web2py source that I used came from > > here: > >http://www.web2py.com/example

Re: [web2py] Re: new URL router use cases

2011-03-24 Thread Jonathan Lundell
On Mar 24, 2011, at 8:04 AM, VP wrote: > > Noticing the version of web2py keeps interestingly increasing to 2.0, > I think this is something Massimo might want to spend sometime > thinking about. > > As I understand it, because of "exec", controllers are called *after* > the request arrives. Thi

Re: [web2py] Re: new URL router use cases

2011-03-24 Thread Anthony
I believe this is already possible, no? The book describes app-specific routing for the old system: http://web2py.com/book/default/chapter/04#Pattern-Based-System And for the new system, the router.example.py file ( http://code.google.com/p/web2py/source/browse/router.example.py) mentions yo

[web2py] Re: can web2py "internal webserver" handle serveral requests in parallel?

2011-03-24 Thread John Heenan
On Mar 22, 7:37 am, olivier wrote: > I plan to use web2py as a simple desktop app service (using the > packaged web2py for windows). > Will the web server (I don't know which server ships in the stand > alone version) handle several requests in parallel if I use ajax calls > to several controller

[web2py] Re: new URL router use cases

2011-03-24 Thread Anthony
On Thursday, March 24, 2011 11:04:39 AM UTC-4, VP wrote: > > Noticing the version of web2py keeps interestingly increasing to 2.0, > I think this is something Massimo might want to spend sometime > thinking about. I don't think the xx part of 1.xx.y is to be interpreted as a decimal with a

Re: [web2py] Re: Class in the session

2011-03-24 Thread Jonathan Lundell
On Mar 24, 2011, at 8:25 AM, Anthony wrote: > There is an additional problem, though. According to Massimo, web2py cannot > store instances of classes in the session: > https://groups.google.com/d/msg/web2py/dmN54cpMuXo/lufvxmaQMLUJ. Perhaps > Massimo has more to say regarding this example. >

Re: [web2py] Re: new URL router use cases

2011-03-24 Thread Martín Mulone
I really want to see routes in the application folder. Routes in the past was hard to follow, now I think the work of Johnatan make it more easy. But when you have many applications, the routes for all is a bit messy. I don't know if this can be done: For example a simple case: Main routes.py: --

[web2py] Re: Class in the session

2011-03-24 Thread Anthony
On Thursday, March 24, 2011 10:04:47 AM UTC-4, NewBeen wrote: > > Hello guys, > > I have this class in a model, > > Class Order: > > def __init__(self): > self.basket={"product":{},"quantity":{}} > >def addProduct(self, Item): >self.basket["product"]["name"]=item["nam

[web2py] Re: new URL router use cases

2011-03-24 Thread VP
Noticing the version of web2py keeps interestingly increasing to 2.0, I think this is something Massimo might want to spend sometime thinking about. As I understand it, because of "exec", controllers are called *after* the request arrives. This allows web2py to do a few interesting things that ot

[web2py] Re: new URL router use cases

2011-03-24 Thread VP
Can't this be done in web2py with something like this? assert(request.args(1) == 'users') yoursitename = request.args(0) On Mar 23, 8:31 am, Anthony wrote: > Massimo, I think Tom was referring to Flask's ability to include an arg at > an arbitrary place in the URL path (e.g., '//users'), not th

Re: [web2py] Re: Runnning my new app

2011-03-24 Thread Anthony
On Thursday, March 24, 2011 10:07:07 AM UTC-4, Kenneth wrote: > > > 2 > 3 > 4 {{=message}} > 5 > 6 > > > This says all, I guess you have copied the whole text even the row numbers. > > You don´t need a HTML or BODY tag, the /views/default/index.html should > only contain > > {{=message}} >

[web2py] Re: Running the web2py mini-fb clone demo (additional info and some questions)

2011-03-24 Thread Anthony
On Thursday, March 24, 2011 8:22:14 AM UTC-4, Arbie Samong wrote: > > thanks for the reply, Anthony. The web2py source that I used came from > here: > http://www.web2py.com/examples/default/download > under Current, which is the file web2py_src.zip and it doesn't seem to > contain either app.ya

Re: [web2py] Re: Runnning my new app

2011-03-24 Thread Kenneth Lundström
2 3 4 {{=message}} 5 6 This says all, I guess you have copied the whole text even the row numbers. You don´t need a HTML or BODY tag, the /views/default/index.html should only contain {{=message}} Row number is shown in the manual only so that it is easier in the text to explain thin

[web2py] Class in the session

2011-03-24 Thread NewBeen
Hello guys, I have this class in a model, Class Order: def __init__(self): self.basket={"product":{},"quantity":{}} def addProduct(self, Item): self.basket["product"]["name"]=item["name"] session.order=Order() So far so good, but when I execute this, the class is always

[web2py] Re: auth_user field default to other auth_user field?

2011-03-24 Thread Massimo Di Pierro
Field('paypal_email', length=128, writable=False, compute=lambda r: r.email)) On Mar 24, 1:38 am, pbreit wrote: > I can't seem to figure out a (good) way to have one of my auth_user fields > default to another auth_user field. I only want the default to take place > once so not "compute". > > I t

[web2py] Re: IS_INT_IN_RANGE Behavior in Database Example

2011-03-24 Thread Massimo Di Pierro
Nope. It was added in 1.94.something On Mar 23, 2011, at 4:45 PM, Anthony wrote: > On Wednesday, March 23, 2011 5:33:45 PM UTC-4, Massimo Di Pierro wrote: > 2) if you want the check done in insert you can call > db.table.validate_and_insert > > How long has that been around? I don't think it's

[web2py] Re: Is it possible to update or insert object to database in one command?

2011-03-24 Thread Massimo Di Pierro
You can do it without if as well: db(query).update(...) or db.mytable.insert(...) On Mar 24, 8:26 am, Massimo Di Pierro wrote: > To know if it exist or not you must have condition in the form of a > query. You can do > > if not db(query).update(...): db.mytable.insert(...) > > where ... is the

[web2py] Re: Is it possible to update or insert object to database in one command?

2011-03-24 Thread Massimo Di Pierro
To know if it exist or not you must have condition in the form of a query. You can do if not db(query).update(...): db.mytable.insert(...) where ... is the field='value' list. On Mar 24, 4:46 am, Sergey Ozhigin wrote: > Hello, > > Is it possible in web2py to update or insert object (if doesn't

[web2py] Re: Running the web2py mini-fb clone demo (additional info and some questions)

2011-03-24 Thread Massimo Di Pierro
I apologize. I thought I made all required changes but I missed one: In controller replace: friends = db(User.id==Link.source) (Link.target==me).select(orderby=alphabetical) requests = db(User.id==Link.target) (Link.source==me).select(orderby=alphabetical) with: friends = db(Link.t

[web2py] Re: delete online user

2011-03-24 Thread Massimo Di Pierro
You have to id the user session and delete it On Mar 24, 6:30 am, Neveen Adel wrote: > Hello, > > Is there a way to when a user delete another online user , the deleted > user logged out ? > > Thanks in Advance

[web2py] Running the web2py mini-fb clone demo (additional info and some questions)

2011-03-24 Thread Arbie Samong
I actually tried the tutorial posted here: http://blip.tv/file/4912976 and here are some information that wasn't mentioned but might be helpful for absolute beginners like me: - You must first register with janrain and take note of the application name - In models/d

[web2py] Is it possible to update or insert object to database in one command?

2011-03-24 Thread Sergey Ozhigin
Hello, Is it possible in web2py to update or insert object (if doesn't exist) to database in one command? Does anybody know an answer? wbr

[web2py] Re: Problems with Google App Engine

2011-03-24 Thread Arbie Samong
I encountered the same error because I tried to point the handler.script field in app.yaml to web2py.py. I changed to gaehandler.py and it worked. So in app.yaml instead of - handlers: - url: .* script: web2py.py I used - handlers: - url: .* script: gaehandler.py Hope that helps. Regards,

[web2py] Re: Converting legacy MySQL databases to web2py DAL

2011-03-24 Thread fib
OK all I feel quite stupid I think I need the ABC of running this I have placed the file in a location where I know where it is and it can be seen in the web2py list I have tried putting the call into shell and into a web2py app I have used IDLE (python) and have tried shell on web2py I believe my

Re: [web2py] Re: another video: web2py components

2011-03-24 Thread Martín Mulone
Also plugin comments, use components to load comments. See code in the page. http://plugin2comment.appspot.com/comments/default/index 2011/3/24 skwasha > Is the source available anywhere? Would be nice to look thru for > tutorial purposes. > > On Mar 22, 2:49 pm, Massimo Di Pierro > wrote: > >

[web2py] Re: Running the web2py mini-fb clone demo (additional info and some questions)

2011-03-24 Thread Anthony
Thank you. This is helpful. Note, the web2py source *does* come with a GAE app.yaml file -- it's in the root web2py/ folder (along with queue.yaml), as explained in the book: http://web2py.com/book/default/chapter/11#Configuration Actually, in the current development version, app.yaml and que

[web2py] delete online user

2011-03-24 Thread Neveen Adel
Hello, Is there a way to when a user delete another online user , the deleted user logged out ? Thanks in Advance

[web2py] Re: another video: web2py components

2011-03-24 Thread skwasha
Is the source available anywhere? Would be nice to look thru for tutorial purposes. On Mar 22, 2:49 pm, Massimo Di Pierro wrote: > http://vimeo.com/21363988 > > Because we do not use them enough and feel we have room for > improvement. > > Massimo

Re: [web2py] Re: OpenERP like widgets

2011-03-24 Thread Indra Gunawan
1. What stuff I need to build like that* web interface? 2. Is there ready to use Python classes that wrap for example ExtJS classes, or the other? 3. Can you points me in general; steps building like that* website using Web2Py? For example. 1. You need this, this and this 2. Do like this in your c

Re: [web2py] Re: onmouseover

2011-03-24 Thread Kenneth Lundström
I got the onmouseover to work but how do I send text to the javascript from a variable. I have this code TD(P(day, _class="text_black"), _class="red", _onmouseover="displayText('info', watchers[check_date])", _onmouseout="hideText('info')") It is the watchers[check_date] that holds the text

[web2py] Re: Problems with Google App Engine

2011-03-24 Thread Web2py Newbie
On Mar 24, 7:16 pm, Arbie Samong wrote: > I'm not sure if my reply was posted so I'm posting again. It happened to me > because I tried to set handlers.script in app.yaml to web2py.py. I used > gaehandler.py instead and it worked. Wow! It worked! Thanks Brendan

[web2py] Re: OpenERP like widgets

2011-03-24 Thread Mengu
what exactly do you need and want us to tell about? On Mar 23, 1:47 pm, Indra Gunawan wrote: > Hi, any idea how to create application (I mean the view, javascript/ajax > widget etc) like thishttp://demo.openerp.com/? > Using Web2Py off course. > > OpenERP also build from python: > 1. Server (XML-

[web2py] Re: OpenERP like widgets

2011-03-24 Thread coderbuzz
Bump... any though? On Mar 23, 6:47 pm, Indra Gunawan wrote: > Hi, any idea how to create application (I mean the view, javascript/ajax > widget etc) like thishttp://demo.openerp.com/? > Using Web2Py off course. > > OpenERP also build from python: > 1. Server (XML-RPC) -> Python > 2. Web Clientht