[web2py:19126] Re: important about ajax forms

2009-04-04 Thread Brian
These might be some additional requirements (let me know what you think): 5) Make it still functional when javascript is turned off. If this doesn't work, sites that require Section 508 compliance won't be able to use jDIV. 6) Nested containers should work (might work already, I haven't tested

[web2py:19125] Controller & sub-folders

2009-04-04 Thread r...@devshell.org
As far as I understand from the manual, it is not possible to store controllers in sub folders in the Controller folder in web2py. Is that right? If that is not correct, what URL would one use to access a function called "user_reg" in a controller called called "useradd" in a folder called "user"

[web2py:19124] Re: Sub query not registering accurately?

2009-04-04 Thread TheDude
Steve, can you explain this more please? And the ~ means "DESC" :) On Apr 5, 12:33 am, Steve Shepherd wrote: > Whats the ~ tilde doing in your code? > The other way to do this is return the rows you want and use an object count > and then use a command to return the last object from the list. >

[web2py:19123] Re: Sub query not registering accurately?

2009-04-04 Thread Steve Shepherd
Whats the ~ tilde doing in your code? The other way to do this is return the rows you want and use an object count and then use a command to return the last object from the list. Rather than do all that sql which is slow put it into the var and use code on the var Steve --~--~-~--~~--

[web2py:19122] Re: How do we do Partial page updates like Ruiby on Rails

2009-04-04 Thread Steve Shepherd
Where can i get a look at the source code for the SQLFORM Class I am interested in making an ajax equivalent. On Fri, Apr 3, 2009 at 5:45 PM, mdipierro wrote: > > not sure what you are asking me. > > Massimo > > On Apr 2, 10:21 pm, Steve Shepherd wrote: > > @Brian > > Thanks for your code. > >

[web2py:19121] Re: Sub query not registering accurately?

2009-04-04 Thread TheDude
Would really like a response to this. =/ On Apr 4, 11:58 am, TheDude wrote: > Tried using this as logging > tool:http://mdp.cti.depaul.edu/AlterEgo/default/show/194 > > But it didn't record where I have the problem at all (even after my > patches). > > The controller: > def view(): >     #try:

[web2py:19120] Re: web2py and Python3

2009-04-04 Thread mdipierro
This issue is not "porting". The issues are: 1) the database drivers have to be ported first. web2py and Django depend more or less on the same drivers 2) web2py supports the Google App Engine and that is Python 2.5. If we move to 3.0 your applications will not run anymore on the GAE. Google has

[web2py:19119] web2py and Python3

2009-04-04 Thread Álvaro Justen [Turicas]
Hello all, is there a timeline to web2py be supported in Python3? I think this information important for who is studing and choosing a web framework, like me. Django, for example, will support Python3 in 2010. -- Álvaro Justen Peta5 - Telecomunicações e Software Livre 21 3021-6001 / 9898-0141

[web2py:19118] Re: important about ajax forms

2009-04-04 Thread Joe Barnhart
The syntax that looks like a list comprehension is really more like a lambda: html submitButton onClick: (html jQuery ajax script: [ :s | s << (s jQuery: #logger) html: DateAndTime now ]); with: 'Replace'. The square brackets above enclose a "block" in Smalltalk. T

[web2py:19117] Re: Dal examples

2009-04-04 Thread DenesL
On Apr 4, 12:47 pm, annet wrote: > I have been exploring the DAL examples which are under documentation > on the website. > > I have got the following model: > > db.define_table('person', >     db.Field('name','string')) > > db.define_table('dog', >     db.Field('name')) > > db.define_table('frie

[web2py:19116] Re: important about ajax forms

2009-04-04 Thread mdipierro
I solved 1), 2) 3) below although I have not yet addressed Yarko's comments. The latest code is here: http://www.web2py.com/examples/static/web2py.app.events.tar And you can try it online here now: http://www.web2py.com/events/default/index Here is the source code of the controller post

[web2py:19115] Re: important about ajax forms

2009-04-04 Thread mdipierro
You can set a very small timeout. On Apr 4, 2:24 pm, ceej wrote: > I think there should defiantly be an option to have the contents > already loaded without having to click a link. > > On Apr 4, 11:50 am, mdipierro wrote: > > > Note to self. Things to be fixed: > > > 1) the action needs knowled

[web2py:19114] Re: important about ajax forms

2009-04-04 Thread ceej
Also a choice of what div to load the response in and maybe even what multiple divs to effect on submit. On Apr 4, 2:24 pm, ceej wrote: > I think there should defiantly be an option to have the contents > already loaded without having to click a link. > > On Apr 4, 11:50 am, mdipierro wrote: >

[web2py:19113] Re: important about ajax forms

2009-04-04 Thread mdipierro
You can jDiv('name',URL(),timeout=0.01) Massimo On Apr 4, 2:24 pm, ceej wrote: > I think there should defiantly be an option to have the contents > already loaded without having to click a link. > > On Apr 4, 11:50 am, mdipierro wrote: > > > Note to self. Things to be fixed: > > > 1) the

[web2py:19112] Re: SQLFORM vs 3rd normal form...

2009-04-04 Thread web2py <<>> technicalbloke.com
Race condition, whoops! Thanks for that Massimo, I knew that should be in there somewhere! :-) On Apr 4, 3:23 pm, "web2py <<>> technicalbloke.com" wrote: > OK, so I just cobbled this together and it seems to work though I'm > sure not in all cases... > > def DBINPUT(table_field): >     types =

[web2py:19111] Re: important about ajax forms

2009-04-04 Thread ceej
I think there should defiantly be an option to have the contents already loaded without having to click a link. On Apr 4, 11:50 am, mdipierro wrote: > Note to self. Things to be fixed: > > 1) the action needs knowledge on whether it is in a container. > Solution: add a header that says so. > >

[web2py:19110] Re: SQLFORM vs 3rd normal form...

2009-04-04 Thread web2py <<>> technicalbloke.com
OK, so I just cobbled this together and it seems to work though I'm sure not in all cases... def DBINPUT(table_field): types = { "string":"text", "blob":"file", "boolean":"checkbox", "integer":"text", "double":"text", "date":"text", "time":"text", "datetime":"text", "passwor

[web2py:19109] Re: reponse.flash and auth.messages problem

2009-04-04 Thread mdipierro
I will look into this. On Apr 4, 12:08 pm, Vidul Petrov wrote: > With this ugly fix: > > session._flash = self.messages.profile_updated # tools.py, added on > line 957 > if session._flash: response.flash = session._flash # some controller > > it works. > > At some point session.flash has been ov

[web2py:19108] Re: SQLFORM vs 3rd normal form...

2009-04-04 Thread mdipierro
You can do this already. from gluon.sqlhml import form_factory form=form_factory(...) arguments can be SQLField, db.mytable.myfield (to clone a field in the form), db.mytable (to clone an entire table). Massimo On Apr 4, 12:00 pm, "web2py <<>> technicalbloke.com" wrote: > Or maybe an addition

[web2py:19107] Re: The official Web2py Book by Massimo....for free?

2009-04-04 Thread r...@devshell.org
I tried to learn web2py without the official manual. After failing to do so, I forked out the $12, and I must say that it is WELL WORTH THE PRICE!!! The book is jam-packed with material. Secondly, if by purchasing the book I am supporting the author's efforts in maintaining and updated web2py, I

[web2py:19106] Re: important about ajax forms

2009-04-04 Thread AchipA
Not disputing the functional aspect of session.forget, just saying it would be more elegant, especially for people who use editors that support folding. On Apr 4, 6:40 pm, mdipierro wrote: > session.forget() > > is there already. > > On Apr 4, 10:59 am, AchipA wrote: > > > Is then this a proper

[web2py:19105] Dal examples

2009-04-04 Thread annet
I have been exploring the DAL examples which are under documentation on the website. I have got the following model: db.define_table('person', db.Field('name','string')) db.define_table('dog', db.Field('name')) db.define_table('friendship', db.Field('person',db.person), db.Fiel

[web2py:19104] Re: important about ajax forms

2009-04-04 Thread Yarko Tymciurak
(literally on my way out the door ... don't know why I looked before shutting down.. but there's always a reason!) On Sat, Apr 4, 2009 at 11:50 AM, mdipierro wrote: > > Note to self. Things to be fixed: > > 1) the action needs knowledge on whether it is in a container. > Solution: add a header t

[web2py:19103] Re: reponse.flash and auth.messages problem

2009-04-04 Thread Vidul Petrov
With this ugly fix: session._flash = self.messages.profile_updated # tools.py, added on line 957 if session._flash: response.flash = session._flash # some controller it works. At some point session.flash has been overwritten? On Apr 4, 7:54 pm, Vidul Petrov wrote: > I copied the content of t

[web2py:19102] Re: SQLFORM vs 3rd normal form...

2009-04-04 Thread web2py <<>> technicalbloke.com
Or maybe an addition to the INPUT helper could turn... INPUT(_type="text", name="contact_name", requires=[ IS_NOT_EMPTY(), IS_LENGTH(255,error_message=T('name too long, max(255)')) ] into INPUT(from_model="db.CONTACTS.contact_name") ? Sorry for blathering on BTW, I'm very excited by web2py -

[web2py:19101] Re: reponse.flash and auth.messages problem

2009-04-04 Thread Vidul Petrov
I copied the content of this line (956) in the previous post. session.flash = self.messages.profile_updated print session.flash # the right string is sent to stdout Could it be session.flash problem? On Apr 4, 7:39 pm, mdipierro wrote: > Look in tools.py line 956. > > On Apr 4, 11:06 am, Vidu

[web2py:19100] Re: important about ajax forms

2009-04-04 Thread mdipierro
Note to self. Things to be fixed: 1) the action needs knowledge on whether it is in a container. Solution: add a header that says so. 2) the action response needs to be able to reference other containers in order to trigger actions there. Right now each container is identified by a unique but r

[web2py:19099] Re: crud.select()

2009-04-04 Thread jmvermeer
Massimo, Thanks for your answering my questions, it helps me get the bigger picture of tools.py. Kind regards, Annet. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this g

[web2py:19098] Re: important about ajax forms

2009-04-04 Thread mdipierro
session.forget() is there already. On Apr 4, 10:59 am, AchipA wrote: > Is then this a proper moment to suggest a > > @nosession > > decorator for controller functions to be able to elegantly > parallelize ? > > On Apr 4, 5:39 pm, mdipierro wrote: > > > If the "components" are all served by the

[web2py:19097] Re: SQLFORM vs 3rd normal form...

2009-04-04 Thread web2py <<>> technicalbloke.com
Or is there a way to create something akin to an old fashioned 'database view' in the model, get SQLFORM to render that and then in the controller validate the fields and insert/update the fields manually? Roger. On Apr 4, 12:23 pm, "web2py <<>> technicalbloke.com" wrote: > I see that it's non

[web2py:19096] Re: reponse.flash and auth.messages problem

2009-04-04 Thread mdipierro
Look in tools.py line 956. On Apr 4, 11:06 am, Vidul Petrov wrote: > The problem is that the following two lines work fine (are copied in > response.flash), > > auth.messages.logged_out = 'You have been logged out successfully' > auth.messages.logged_in = 'You have been logged in successfully' >

[web2py:19095] Re: SQLFORM vs 3rd normal form...

2009-04-04 Thread web2py <<>> technicalbloke.com
I see that it's non-trivial but maybe 1,3 and 4 could be negated by using the following syntax (2 I'm not so sure about)... COMPOUNDFORM( db.TABLE1,db.TABLE2, db.TABLE3, fields= [ db.TABLE1.name, db.TABLE2.email, db.TABLE3.phone ], relations [ db.TABLE1.id==db.TABLE2.contact_id, db.TABLE1.id==db

[web2py:19094] Re: reponse.flash and auth.messages problem

2009-04-04 Thread Vidul Petrov
Thank you, I tried, but I subclassing doesn't fix the problem. >From "tools.py" - session.flash = self.messages.profile_updated Probably some problem with session.flash? On Apr 4, 7:16 pm, TheDude wrote: > Vidul. > Take a look at this page:http://mdp.cti.depaul.edu/examples/default/tools > >

[web2py:19093] Re: reponse.flash and auth.messages problem

2009-04-04 Thread TheDude
Vidul. Take a look at this page: http://mdp.cti.depaul.edu/examples/default/tools Under "Custom Authentication" On Apr 4, 12:06 pm, Vidul Petrov wrote: > The problem is that the following two lines work fine (are copied in > response.flash), > > auth.messages.logged_out = 'You have been logged

[web2py:19092] Re: Writing a Book

2009-04-04 Thread ice9
It would be great to have a in-depth book that covers web2py i would buy it. On Apr 4, 4:02 pm, cadrentes wrote: > I guess I shouldn't use 'programming'. I suppose 'development' is a > better word for putting together a project on web2py. That's what's > great about web2py. I can develop an a

[web2py:19091] reponse.flash and auth.messages problem

2009-04-04 Thread Vidul Petrov
The problem is that the following two lines work fine (are copied in response.flash), auth.messages.logged_out = 'You have been logged out successfully' auth.messages.logged_in = 'You have been logged in successfully' but these do not appear anywhere (while trying "user/profile" and "user/profil

[web2py:19090] Re: Writing a Book

2009-04-04 Thread cadrentes
I guess I shouldn't use 'programming'. I suppose 'development' is a better word for putting together a project on web2py. That's what's great about web2py. I can develop an application without being a programmer. But I am expecting to learn what {{pass}} means, eventually, and pick apart the .p

[web2py:19089] Re: Input type button

2009-04-04 Thread r...@devshell.org
I ended up buying the book as I feel I need to start there. Thanks for writing it and for making it available as PDF for under $20 On Apr 3, 5:58 pm, mdipierro wrote: > I am not sure I fully understand the question since this is not a > web2py specific questions. > > If a page has a button

[web2py:19088] Re: important about ajax forms

2009-04-04 Thread AchipA
Is then this a proper moment to suggest a @nosession decorator for controller functions to be able to elegantly parallelize ? On Apr 4, 5:39 pm, mdipierro wrote: > If the "components" are all served by the same they are serialized > even if served via ajax. If they are served by different apps

[web2py:19087] Sub query not registering accurately?

2009-04-04 Thread TheDude
Tried using this as logging tool: http://mdp.cti.depaul.edu/AlterEgo/default/show/194 But it didn't record where I have the problem at all (even after my patches). The controller: def view(): #try: board = db(db.mb_boards.id==request.args[0]).select()[0] rows = (db.auth_user.

[web2py:19086] Re: web2py desktop / web app

2009-04-04 Thread AchipA
We might be not talking about the same thing. Most of these solutions basically convert/render HTML into something desktop friendly. If you want to keep the HTML component as-is, you can go with plain vanilla webkit that is in qt since 4.4.x http://www.youtube.com/watch?v=Ee8eRwjbcFk (this would b

[web2py:19085] twitting form web2py?

2009-04-04 Thread mdipierro
Is the author of this here? http://twitter.com/trevortest Massimo --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubsc

[web2py:19084] Re: important about ajax forms

2009-04-04 Thread mdipierro
Thank you. Excellent paper. I will get back to you on this. On Apr 4, 2:02 am, Joe Barnhart wrote: > I think Yarko makes excellent points.  I too am looking for the > natural way to express components in Web2py and the code proposed by > Massimo originally did not look general enough.  The bett

[web2py:19083] Re: important about ajax forms

2009-04-04 Thread mdipierro
If the "components" are all served by the same they are serialized even if served via ajax. If they are served by different apps that do not share a session then they are not serialized. There is no possibility of deadlocks. Everything is parallelized if there you do not use session. Massimo On

[web2py:19082] Re: important about ajax forms

2009-04-04 Thread mdipierro
Check views/web2py_ajax.html it should have one more function when compared to the normal web2py_ajax.html. It may look the same but it is not. On Apr 4, 3:41 am, Iceberg wrote: > I want to test this idea, but it seems the events.tar does not contain > that magic new web2py_ajax.html ?  Did I mi

[web2py:19081] Re: crud.select()

2009-04-04 Thread mdipierro
> - what do the parameters: self, table, headers and **attr reference. self is the current object (Crud()), this is standard in python classes (like "this" in Java) table is the name of a table to be shown, attr are additional optional names arguments. > - how does this function produce joins on

[web2py:19080] Re: SQLFORM vs 3rd normal form...

2009-04-04 Thread mdipierro
what you say could be implemented but it would not be general enough to satisfy every user. 1) why be limited to two tables 2) is this a one-to-one or one-to-many? 3) in which order the fields should be listed 4) what if the two tables have fiends with the same name ... there are many issue that

[web2py:19079] Re: WARNING:root:unable to import dbhash (only from external cron)

2009-04-04 Thread mdipierro
The -R may be causing the problem. Running scripts instead of action requires manual committing the db. On Apr 4, 5:40 am, AchipA wrote: > BTW Just out of curiosity, why are you calling -R ...test.py in your > crontab ? It looks fairly redundant to me (you should call it within > appname's cron/

[web2py:19078] Re: The official Web2py Book by Massimo....for free?

2009-04-04 Thread Yarko Tymciurak
On Sat, Apr 4, 2009 at 9:48 AM, Yarko Tymciurak wrote: > *snip*. > > Hopefully people will stop talking about the book, stop "writing their own > book which will be free" and instead pitch in to help with the new manual. > By the way, I have nothing against people wanting to write books...

[web2py:19077] Re: important about ajax forms

2009-04-04 Thread weheh
I'm so very glad to see this thread. Frankly, I think partial page updates targeted at an individual should be the default behavior of web2py (and all web frameworks), not the other way. If you want to refresh the entire page, just say so. I do not have any concrete suggestions to help you do thi

[web2py:19076] crud.select()

2009-04-04 Thread annet
I have a couple of questions about the select() function in tools.py - what do the parameters: self, table, headers and **attr reference. - how does this function produce joins on tables. - what happens here: if isinstance(table, str): if not table in self.db.tables:

[web2py:19075] Re: The official Web2py Book by Massimo....for free?

2009-04-04 Thread web...@technicalbloke.com
Well for a platform to become viable the people who build it need to get paid somehow, certainly until you get a critical mass of developers who can contribute on their own time. I don't know Massimo's situation but I'm guessing he isn't funded by any huge companies to develop this and $12 for an

[web2py:19074] SQLFORM vs 3rd normal form...

2009-04-04 Thread web...@technicalbloke.com
Hi All, I must be missing something, I've read the book's chapter on SQLFORM and the bit about "Links to referencing records" but I still can't get my head round how to make a compound form, i.e. one with fields from multiple tables. Here's are my tables... db.define_table('CONTACTS', SQLFie

[web2py:19073] Re: The official Web2py Book by Massimo....for free?

2009-04-04 Thread Yarko Tymciurak
People seem to continually have trouble with this. There is (in my mind) some good education in this: recognition of natural system boundaries - Massimo's publications or state (free or not) is not in your domain (only your requests are). Any question of "why" is analogous to innappropriate contr

[web2py:19072] Re: important about ajax forms

2009-04-04 Thread Yarko Tymciurak
On Sat, Apr 4, 2009 at 2:02 AM, Joe Barnhart wrote: > > I think Yarko makes excellent points. I too am looking for the > natural way to express components in Web2py and the code proposed by > Massimo originally did not look general enough. The better job we do > at abstracting this and generali

[web2py:19071] Re: The official Web2py Book by Massimo....for free?

2009-04-04 Thread Michal Jursa
That's absolutely not about money and I understand the reasons only partially, but if you are seriously interested in web2py, $10 is not so much. I hope Massimo will clear this all on website soon :) Michal alias Plysak Pystar napsal(a): > If Massimo is concerned about money (which isnt strang

[web2py:19070] Re: The official Web2py Book by Massimo....for free?

2009-04-04 Thread Kuba Kucharski
IT IS NOT ABOUT THE MONEY http://groups.google.com/group/web2py/msg/fa8ed72beefa7100 http://groups.google.com/group/web2py/msg/334375c7e0c4be53 Please, google before asking a question. -- Kuba --~--~-~--~~~---~--~~ You received this message because you are subs

[web2py:19069] Re: The official Web2py Book by Massimo....for free?

2009-04-04 Thread Pystar
If Massimo is concerned about money (which isnt strange in the light of things), i feel that the expose and awareness that will be created by releasing the official web2py book as a free download will over compensate for anything else. Even more revenue will be made because people who read the ebo

[web2py:19068] Re: web2py desktop / web app

2009-04-04 Thread Yarko Tymciurak
On Sat, Apr 4, 2009 at 5:28 AM, AchipA wrote: > > Another fairly easy to do alternative would be Qt through webkit, if > you don't mind the size. Looking at http://pyjd.org/ they seem to suggest that Qt is not ready to go (no PyWebkitQt4 yet; indeed http://trac.webkit.org/wiki/QtWebKitContrib s

[web2py:19067] Re: The official Web2py Book by Massimo....for free?

2009-04-04 Thread Michal Jursa
And again Massimo you should place some really deep and exact explanation about the book status and reasons why it is not free to the website..:) Michal alias Plysak Pystar napsal(a): > I had this weird idea today, in other to bring web2py which IMHO is > the best python framework out ther

[web2py:19066] The official Web2py Book by Massimo....for free?

2009-04-04 Thread Pystar
I had this weird idea today, in other to bring web2py which IMHO is the best python framework out there, i would suggest that the official web2py book be made a free download. i give my reasons below: 1. Any newbie who wants to try out web2py might not be interested in reading the source code, or

[web2py:19065] Re: important about ajax forms

2009-04-04 Thread AchipA
Just an itsy bitsy note. How does this stuff handle sessions ? Joe B has mentioned something that touches on this - web2py (and most frameworks) use sessions to create an application level context. The slight problem is if you introduce blocks that are supposed to work/ load in parallel, it will b

[web2py:19064] Re: WARNING:root:unable to import dbhash (only from external cron)

2009-04-04 Thread AchipA
BTW Just out of curiosity, why are you calling -R ...test.py in your crontab ? It looks fairly redundant to me (you should call it within appname's cron/crontab). 0-59/1 * * * * cd /Users/username/Desktop/appname/web2py && python web2py.py -R applications/appname/controllers/test.py -C -D 1 >> /t

[web2py:19063] Re: WARNING:root:unable to import dbhash (only from external cron)

2009-04-04 Thread AchipA
Hm, good question. When calling a controller function form cron, I really just wrap a system call to python web2py.py -S (that way we have no issues with thread safety, etc). Thus, for whatever reason you need the update, you would need it anyway if you used python web2py.py -S while you have web2

[web2py:19062] Re: web2py desktop / web app

2009-04-04 Thread AchipA
Another fairly easy to do alternative would be Qt through webkit, if you don't mind the size. On Apr 4, 5:28 am, mdipierro wrote: > I believe ceej has been working with web2py + titanium. Perhaps he can > give us some advice. > > On Apr 3, 8:15 pm, ice9 wrote: > > > I have been reading and hear

[web2py:19061] Re: important about ajax forms

2009-04-04 Thread Iceberg
I want to test this idea, but it seems the events.tar does not contain that magic new web2py_ajax.html ? Did I miss something? On Apr4, 2:02pm, mdipierro wrote: > I re-posted a slightly better version. > > The new version work in this way: > > say you have an action like: > > def myform(): >  

[web2py:19060] Re: important about ajax forms

2009-04-04 Thread Joe Barnhart
I think Yarko makes excellent points. I too am looking for the natural way to express components in Web2py and the code proposed by Massimo originally did not look general enough. The better job we do at abstracting this and generalizing it, the more capable the web2py platform will be. One of