[web2py:26104] Re: drop-box that keeps previous value
The question to ask here is what would it take to have a drop box keep the previous value as default. It was just a thought. While entering data into a timetable table I found it inconvenient that I had to select the day time and again from the drop box, which defaults to Monday. Same thing when I entered data into a table that contains the opening hours of a creche facility in a fitness and health club. In this case I would like to keep the day (defaults to Monday) and the facility (ordered alphabetically), not the time fields. As I said, just a thought to improve usability to the user. This should be a relatively simple quesition if you are talking about a value last saved - boiling down to now that I've selected / retrieved the last value, how do I programmatically set that as the default in the form? The problem is I lack the proficiency in Python to program something like this myself. Becoming proficient in Python figures highest on my to do list, e.g. I need validators based on key value pairs in query results, not being able to program them myself is rather frustrating Try if form.accepts(...,keepvalues=True) does what you ask. keepvalues=True keeps all the values, whereas I only want to keep specific values. Kind regards, Annet. --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26105] DAL remote control
Thx for the speedy reply. Here's another question: 3) Because I'm doing a thick client, it creates db queries (SQL CRUD) which need to be communicated back to the controller which must query the db. The two ways to do this are: a) use a SQL statement within a executesql command, or b) create a DAL row selection criteria string and a column selection criteria string, send them back to the controller which feeds them through a python eval statement within a DAL function. It is always pointed out that b) is dangerous because it's possible for unintended string matter to get fed into the eval - which can reek havoc. However only *my* strings from the client which I have carefully massaged will ever be sent (e.g. I collect the column names from the db beforehand and provide them to the db().select(fieldnames- here) statement). Further, if I craft a SQL string then it too can suffer from bad input. I just have to be extra careful when creating the query strings. However if I use a) then I lose all of the functionality provided by the DAL. I've never been a fan of SQL and I'd like to avoid it in favour of what the DAL can offer. So I've implemented b) and it is working. My questions are: i) am I missing the obvious? Is there a much simpler/better way to do this? ii) does the DAL add much overhead? On Jul 9, 9:21 pm, mdipierro mdipie...@cs.depaul.edu wrote: On Jul 9, 11:04 pm, rb rbspg...@gmail.com wrote: Hi all, I'm using Web2py to serve a wxPython thick client via XMLRPC. I'm currently using SQLite (I like the zero db config ;-) and I have a few questions: 1) I have missed how to specify table constraints across several fields (in SQLite). For example, in a table the primary key consists of two fields - how do I specify that these two fields must comprise a UNIQUE value? In other dbs I could use executesql to just give the SQL commands, but SQLite (unless I'm mistaken) only allows table constraints within the CREATE TABLE SQL command. So can this be done in Web2py? You cannot create such constraint database side from web2py. Your options are: 1) enforce the constraint at the validators level 2) create the table outside web2py and set migrate=False 2) I'm confused as to which models get run when a controller is accessed. If I have db.py and uom.py models and I access the uom controller, what happens? From stepping thru the debugger I saw db.py get run first, then uom.py and then uom.py again (weird). I've simplified things down to just one (db.py) file for now, but I'm wondering if the infrastructure's intent is to run all model files upon each and every controller access. Oh, my access of the controller is via XMLRPC function (if that changes anything). All of them. Alphabetically. There has been some discussion on whether there should be exceptions to this rule. It would be easy to inplmenet but there was no consensus on whether an improvement was necessary. --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:/] Re: IS_NOT_IN_DB() and no automatic drop box
Massimo, Thanks for putting so much effort in solving this problem. I tried the latest trunk and replaced my code with the code you provided, the error ticket I get reads like: Traceback (most recent call last): File /Library/Python/2.5/site-packages/web2py/gluon/restricted.py, line 176, in restricted exec ccode in environment File /Library/Python/2.5/site-packages/web2py/applications/cms/ controllers/appadmin.py, line 255, in module File /Library/Python/2.5/site-packages/web2py/gluon/globals.py, line 103, in lambda self._caller = lambda f: f() File /Library/Python/2.5/site-packages/web2py/applications/cms/ controllers/appadmin.py, line 103, in insert form = SQLFORM(db[table], ignore_rw=ignore_rw) File /Library/Python/2.5/site-packages/web2py/gluon/sqlhtml.py, line 583, in __init__ elif field.type == 'upload': File /Library/Python/2.5/site-packages/web2py/applications/cms/ models/db.py, line 278, in lambda db.companyactivity.activity.widget=lambda f,v: OptionsWidget.widget (db.companyactivity.activity,v) File /Library/Python/2.5/site-packages/web2py/gluon/sqlhtml.py, line 195, in widget options = requires0.other.options() SyntaxError: widget cannot determine options of companyactivity.activity Since the key value pairs should come from the activity table I gave that a try: db.companyactivity.activity.widget=lambda f,v: OptionsWidget.widget (db.activity.activity,v) .. but that results in the same error. I hope you're close to solving this problem. Kind regards, Annet. --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26107] Re: SQLite table constraints and which model files are run?
2) I'm confused as to which models get run when a controller is accessed. If I have db.py and uom.py models and I access the uom controller, what happens? From stepping thru the debugger I saw db.py get run first, then uom.py and then uom.py again (weird). I've simplified things down to just one (db.py) file for now, but I'm wondering if the infrastructure's intent is to run all model files upon each and every controller access. Oh, my access of the controller is via XMLRPC function (if that changes anything). All of them. Alphabetically. There has been some discussion on whether there should be exceptions to this rule. It would be easy to inplmenet but there was no consensus on whether an improvement was necessary. Is the session object defined when db.py is run? Could it be used to send info for relevant-table declaration in order to prune down the number of db.define_table statements? Does anyone have a feel for what the overhead is of defining/declaring a bunch of tables (in db.py) (which will never be used) - ie. is this expensive? I suppose this greatly depends on the db used. For SQLite, are the db.define_table() calls expensive? My (typical/ordinary) CRUD program is segmented into a number of documents (or multitable forms). However each will only touch a few of the many tables. Would this make a case for db table-declaration segmentation? BTW kudos to everyone involved in making web2py. For me, it has made it _possible_ to get an app up and running quickly. I originally tried to wade my way through learning Zope but it just made my head hurt. I briefly looked at Django but after Zope I didn't think it differed enough. I stumbled upon web2py almost by accident while surf... researching and your feature list hooked me. I was able to convince others (who are not technical minded at all) to choose this because the benefits were so many and so understandable. Kudos. --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26108] Re: DAL remote control
I just have to point this out: by definition (at least some) thick clients operate regardless of being connected to a network or not... So - here's anther way to talk about that concept; Given a network architecture something like this: Presentatoin -- Logic Data persistence or device layer (and we could show this as 4 or 5 layers, but the point remains the same) it is a design choice where you put the network boundray. Presentation -- network -- Logic Data Layer would be what is typically called a thin client: the business and engineering logic is on the server; you can't run without it. In web2py terms, the models and controllers are the two server layers. Now, this change: Presentation - Logic --- network -- Data Layer would be the fundamental change that would make for a thick / rich client. Now, it can get fuzzy in the details - Flash (for example) is a rich client which runs symbiotically with a rich server, BUT for these purposes, a flash application in your browser (however rich) does not make for an application that can run free of the network. SO - my point is this: web2py is a server-based application host, for use with what would normally be called thin clients. That is not to say that you could not have a thick client that would interact symbiotically with a web2py server, but I would think that would be through services. When I read your question, and your statement about thick client, and how you get web2py to work with it, I cannot help but wonder - whcih are you doing -- building a thick client, or building a web2py application? (Of course you could be doing both, but that would be somewhat a special case, and interesting in more details and discussion). Regards - Yarko On Fri, Jul 10, 2009 at 1:55 AM, rb rbspg...@gmail.com wrote: Thx for the speedy reply. Here's another question: 3) Because I'm doing a thick client, it creates db queries (SQL CRUD) which need to be communicated back to the controller which must query the db. The two ways to do this are: a) use a SQL statement within a executesql command, or b) create a DAL row selection criteria string and a column selection criteria string, send them back to the controller which feeds them through a python eval statement within a DAL function. It is always pointed out that b) is dangerous because it's possible for unintended string matter to get fed into the eval - which can reek havoc. However only *my* strings from the client which I have carefully massaged will ever be sent (e.g. I collect the column names from the db beforehand and provide them to the db().select(fieldnames- here) statement). Further, if I craft a SQL string then it too can suffer from bad input. I just have to be extra careful when creating the query strings. However if I use a) then I lose all of the functionality provided by the DAL. I've never been a fan of SQL and I'd like to avoid it in favour of what the DAL can offer. So I've implemented b) and it is working. My questions are: i) am I missing the obvious? Is there a much simpler/better way to do this? ii) does the DAL add much overhead? On Jul 9, 9:21 pm, mdipierro mdipie...@cs.depaul.edu wrote: On Jul 9, 11:04 pm, rb rbspg...@gmail.com wrote: Hi all, I'm using Web2py to serve a wxPython thick client via XMLRPC. I'm currently using SQLite (I like the zero db config ;-) and I have a few questions: 1) I have missed how to specify table constraints across several fields (in SQLite). For example, in a table the primary key consists of two fields - how do I specify that these two fields must comprise a UNIQUE value? In other dbs I could use executesql to just give the SQL commands, but SQLite (unless I'm mistaken) only allows table constraints within the CREATE TABLE SQL command. So can this be done in Web2py? You cannot create such constraint database side from web2py. Your options are: 1) enforce the constraint at the validators level 2) create the table outside web2py and set migrate=False 2) I'm confused as to which models get run when a controller is accessed. If I have db.py and uom.py models and I access the uom controller, what happens? From stepping thru the debugger I saw db.py get run first, then uom.py and then uom.py again (weird). I've simplified things down to just one (db.py) file for now, but I'm wondering if the infrastructure's intent is to run all model files upon each and every controller access. Oh, my access of the controller is via XMLRPC function (if that changes anything). All of them. Alphabetically. There has been some discussion on whether there should be exceptions to this rule. It would be easy to inplmenet but there was no consensus on whether an improvement was necessary. --~--~-~--~~~---~--~~ You received this message because you are
[web2py:26109] Re: DAL remote control
I understand that Rb does something like I am doing: uses web2py with SQLite for standalone mode; without a server. At least this feature initially convinced me to try web2py. This make a very appealing proposition: use simple, easy to use tools (python + html) to develop a cross-platform application with quite rich user interface, and who cares that it's technically a web app. That he calls a thick client. Is that true? I started with this but quickly went beyond SQLite capabilities, so my app has turned into full blown intranet application with oracle backend, but I still advertize its demo version as standalone app. I wrote once a while ago when we discussed killer apps for web2py, that there is quite a market for standalone application based on web technologies and basically all we need to add is a native platform wrapper for browser that automatically runs web2py server and opens browser at localhost:8000. Sorry for offtopic. On Jul 10, 11:31 am, Yarko Tymciurak yark...@gmail.com wrote: I just have to point this out: by definition (at least some) thick clients operate regardless of being connected to a network or not... So - here's anther way to talk about that concept; Given a network architecture something like this: Presentatoin -- Logic Data persistence or device layer (and we could show this as 4 or 5 layers, but the point remains the same) it is a design choice where you put the network boundray. Presentation -- network -- Logic Data Layer would be what is typically called a thin client: the business and engineering logic is on the server; you can't run without it. In web2py terms, the models and controllers are the two server layers. Now, this change: Presentation - Logic --- network -- Data Layer would be the fundamental change that would make for a thick / rich client. Now, it can get fuzzy in the details - Flash (for example) is a rich client which runs symbiotically with a rich server, BUT for these purposes, a flash application in your browser (however rich) does not make for an application that can run free of the network. SO - my point is this: web2py is a server-based application host, for use with what would normally be called thin clients. That is not to say that you could not have a thick client that would interact symbiotically with a web2py server, but I would think that would be through services. When I read your question, and your statement about thick client, and how you get web2py to work with it, I cannot help but wonder - whcih are you doing -- building a thick client, or building a web2py application? (Of course you could be doing both, but that would be somewhat a special case, and interesting in more details and discussion). Regards - Yarko On Fri, Jul 10, 2009 at 1:55 AM, rb rbspg...@gmail.com wrote: Thx for the speedy reply. Here's another question: 3) Because I'm doing a thick client, it creates db queries (SQL CRUD) which need to be communicated back to the controller which must query the db. The two ways to do this are: a) use a SQL statement within a executesql command, or b) create a DAL row selection criteria string and a column selection criteria string, send them back to the controller which feeds them through a python eval statement within a DAL function. It is always pointed out that b) is dangerous because it's possible for unintended string matter to get fed into the eval - which can reek havoc. However only *my* strings from the client which I have carefully massaged will ever be sent (e.g. I collect the column names from the db beforehand and provide them to the db().select(fieldnames- here) statement). Further, if I craft a SQL string then it too can suffer from bad input. I just have to be extra careful when creating the query strings. However if I use a) then I lose all of the functionality provided by the DAL. I've never been a fan of SQL and I'd like to avoid it in favour of what the DAL can offer. So I've implemented b) and it is working. My questions are: i) am I missing the obvious? Is there a much simpler/better way to do this? ii) does the DAL add much overhead? On Jul 9, 9:21 pm, mdipierro mdipie...@cs.depaul.edu wrote: On Jul 9, 11:04 pm, rb rbspg...@gmail.com wrote: Hi all, I'm using Web2py to serve a wxPython thick client via XMLRPC. I'm currently using SQLite (I like the zero db config ;-) and I have a few questions: 1) I have missed how to specify table constraints across several fields (in SQLite). For example, in a table the primary key consists of two fields - how do I specify that these two fields must comprise a UNIQUE value? In other dbs I could use executesql to just give the SQL commands, but SQLite (unless I'm mistaken) only allows table constraints within the CREATE TABLE SQL command. So can this be
[web2py:26110] Re: DAL remote control
Interesting post, Yarko. I think Sergey has a good idea of what I'm up to (gee, I didn't discover/invent this?;-) My plan is to use web2py to provide the business logic and db, ie the server functionality, although it will co-exist on the same machine as the thick client (until the project moves along quite a bit). However, I distinguish the diff between a thick and thin client not by where I place the business logic (the only logic on the client is validation-code) but by what means (or protocol) the high-speed interaction of the user input/feedback with the business logic takes place (whew!). For a clarification of that last sentence consider a simple webpage with an html form. It is the prototypical thin client because there is (almost) no client side logic. In comes ajax and google and you have a whole ecosystem of ajax technologies (like Google Web Toolkit) which can greatly speed up the interaction of the thin client with the user - using javascript, the web browser can now run client side logic, yet we still call this a thin client - even if that muddies the waters. A thick client, because it has great client side code-power, can have all sorts of fancy-shmancy widgets (we'll ignore Google and their GWT for now), that can interact at high speed with the user. If this client only does (rudimentary) validation of input and sends the bulk of the raw data over to the server, where business logic there processes it then I call this a thick client and (I assert) it is not rally doing any more of the business logic than the thin client, it's just much faster interacting with the user. So, before the advent of ajax, the choice was between simplistic (and slow) thin clients (that required no deployment) and fast, fancy, interactive thick clients that required deployment and complicated/low- level communication protocols (like sockets). Today the choice seems (to me) to be to use ajax and thin clients. However, I'm new to this web programming gig (previous experience in CRUD apps and systems programming) and I worked thru Google's GWT example app on line. OH_MY_GAWD. You've GOT to be kidding me. To generate an app which has a textbox and can populate a list from entries in the textbox which pretends to be a stock ticker with a timer that fires to update (random) deltas in the stock price involves PAGES of code. Great heaping GOBS of code. Code of all manner. CSS stuff, XML, blah blah blah. My old company has a team of twenty writing their ajax/GWT platform for their app and they've been at it for 6 months now - they're now getting ready to hand the SDK over to the app programmers. I don't have the resources for ajax thin client programming. I'll stick with the trials of deploying the thick client. But wait, I'll also need to generate lots of reports and you could burn me with fire before I'll slog through using Crystal Reports for this. No, I can use Web2py and python and code up some html reports from the db. The entry forms and inquiry forms of the thick client I'm doing in wxPython will work fine. I can use xmlrpc for the client-to- svr protocol. Who cares if its grossly slow ? (even though I'm led to believe that it's not so slow) if it's all on the same machine. However, the customer wants to see his reports from his browser out on the 'net somewhere. How can I deliver such? Oh look, there's web2py. Awesome. In a few short days of reading even *I* can understand how to hack something together - and I'm just starting (in python). I've still got to watch out for the speed of communication issue but that's tomorrow's problem and there won't be a tomorrow if I have to use ajax. But again, I'm kinda new to all this stuff, so I stand to be corrected if I'm being naive... ;-) --- Rb On Jul 10, 12:31 am, Yarko Tymciurak yark...@gmail.com wrote: I just have to point this out: by definition (at least some) thick clients operate regardless of being connected to a network or not... So - here's anther way to talk about that concept; Given a network architecture something like this: Presentatoin -- Logic Data persistence or device layer (and we could show this as 4 or 5 layers, but the point remains the same) it is a design choice where you put the network boundray. Presentation -- network -- Logic Data Layer would be what is typically called a thin client: the business and engineering logic is on the server; you can't run without it. In web2py terms, the models and controllers are the two server layers. Now, this change: Presentation - Logic --- network -- Data Layer would be the fundamental change that would make for a thick / rich client. Now, it can get fuzzy in the details - Flash (for example) is a rich client which runs symbiotically with a rich server, BUT for these purposes, a flash application in your browser (however rich) does not make for an application that can run free of the network. SO -
[web2py:26112] Re: One professional app to showcase Web2py
Great idea!! It should also include DIM/DIM support, SMS/VoIP Conference support -G --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26113] latest sqlhtml.py breaks update function
After replacing the sqlhtml file with the latest sqlhtml file in trunk I get the following error ticket on all my update functions: Error traceback Traceback (most recent call last): File /Library/Python/2.5/site-packages/web2py/gluon/restricted.py, line 176, in restricted exec ccode in environment File /Library/Python/2.5/site-packages/web2py/applications/cms/ controllers/tier2.py, line 164, in module File /Library/Python/2.5/site-packages/web2py/gluon/globals.py, line 103, in lambda self._caller = lambda f: f() File /Library/Python/2.5/site-packages/web2py/gluon/tools.py, line 1371, in f return action(*a, **b) File /Library/Python/2.5/site-packages/web2py/applications/cms/ controllers/tier2.py, line 47, in update_activity form=update_form(db.bedrijfactiviteit,record,'crud_activity') File /Library/Python/2.5/site-packages/web2py/applications/cms/ models/db.py, line 704, in update_form form=crud.update(table,rec,next=(URL(r=request,f=nxt))) File /Library/Python/2.5/site-packages/web2py/gluon/tools.py, line 1756, in update keepvalues=self.settings.keepvalues): File /Library/Python/2.5/site-packages/web2py/gluon/sqlhtml.py, line 837, in accepts if fields[fieldname] != None: KeyError: 'activity' Kind regards, Annet. --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26114] Re: latest sqlhtml.py breaks update function
What version where you using before (please spicy svn or bazaar/launchpad) ? Can you (perhpas) try what version is still working: see eg http://bazaar.launchpad.net/~mdipierro/web2py/devel/changes?filter_file_id=sqlhtml.py-20080629222958-hhdxylrn88oe0xku-48 Can you show some simple code that we can use to reproduce this? On Fri, Jul 10, 2009 at 2:21 PM, annetannet.verm...@gmail.com wrote: After replacing the sqlhtml file with the latest sqlhtml file in trunk I get the following error ticket on all my update functions: Error traceback Traceback (most recent call last): File /Library/Python/2.5/site-packages/web2py/gluon/restricted.py, line 176, in restricted exec ccode in environment File /Library/Python/2.5/site-packages/web2py/applications/cms/ controllers/tier2.py, line 164, in module File /Library/Python/2.5/site-packages/web2py/gluon/globals.py, line 103, in lambda self._caller = lambda f: f() File /Library/Python/2.5/site-packages/web2py/gluon/tools.py, line 1371, in f return action(*a, **b) File /Library/Python/2.5/site-packages/web2py/applications/cms/ controllers/tier2.py, line 47, in update_activity form=update_form(db.bedrijfactiviteit,record,'crud_activity') File /Library/Python/2.5/site-packages/web2py/applications/cms/ models/db.py, line 704, in update_form form=crud.update(table,rec,next=(URL(r=request,f=nxt))) File /Library/Python/2.5/site-packages/web2py/gluon/tools.py, line 1756, in update keepvalues=self.settings.keepvalues): File /Library/Python/2.5/site-packages/web2py/gluon/sqlhtml.py, line 837, in accepts if fields[fieldname] != None: KeyError: 'activity' Kind regards, Annet. --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26115] Re: DAL remote control
On Jul 10, 10:43 am, Yarko Tymciurak yark...@gmail.com wrote: Regardless, you are trying to use something other than a browser for the client end (if I recall) wxPython, yes , so that does deserve some extra discussion, as the view part of web2py assumes an html / xhtml client (that's what it generates to send out the wire, that's the protocol. Access is purely via WebServices which I see as being very important another area which Web2Py makes easy (to start with at least). I'm personally more into JSON than XML for WAN performance but this is designed to be on localhost, so XML is just fine... Web2Py does in fact include view templates for these formats: generic.json generic.xml I've not tried these myself yet though. F --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26117] Re: DAL remote control
On Jul 10, 9:40 am, rb rbspg...@gmail.com wrote: I don't have the resources for ajax thin client programming. I'll stick with the trials of deploying the thick client. I don't think you need full-blown GWT to have an AJAX client. jQuery (integrated with Web2Py) allows 'progressive enhancement' of plain old HTML to increase interactivity. e.g. look at the miracle of the dataTables plugin which I'm just about to make use of: http://www.datatables.net/ But wait, I'll also need to generate lots of reports and you could burn me with fire before I'll slog through using Crystal Reports for this. No, I can use Web2py and python and code up some html reports from the db. The entry forms and inquiry forms of the thick client I'm doing in wxPython will work fine. Even easier if you let Web2Py build these for you via sqlhtml.py :) You can AJAXify the forms using jQuery Form plugin if you like... I can use xmlrpc for the client-to- svr protocol. Who cares if its grossly slow ? (even though I'm led to believe that it's not so slow) if it's all on the same machine. Same machine = no big issue...JSON is only better for WAN performance. However, the customer wants to see his reports from his browser out on the 'net somewhere. How can I deliver such? Oh look, there's web2py. Awesome. In a few short days of reading even *I* can understand how to hack something together - and I'm just starting (in python). I've still got to watch out for the speed of communication issue but that's tomorrow's problem and there won't be a tomorrow if I have to use ajax. Well, I think that maybe you'd be better with Web2Py/jQuery rather than Web2Py/wxPython. However what you propose is also ok... F --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26119] Re: new chapters for the book CRUD and AUTH
On Jul 10, 2:33 am, rb rbspg...@gmail.com wrote: Currently I'm using SQLite for the db although later I might switch to postgres. I'm trying to understand how best to create my tables (eg. how to specify a UNIQUE constraint over two or three fields for my primary key?). Oh gosh, I shouldn't post my questions here. Here is an example of a custom multi-table IS_IN_DB(): http://groups.google.com/group/web2py/browse_thread/thread/cae53d68c91938c5 You want one for IS_NOT_IN_DB() Original is in gluon/validators.py F --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26121] ip of a logged-in-user
Hi, I don't know whether web2py has this built-in, but here's concept: table logged_in: user_id, time time is time of user's last activity When user opens some page or downs a file, or just does something, then you update logged_in.time to actual time. Now, if you want to see list of logged in users in last 5 minutes, just: select user_id, time from logged_in where time=NOW()-5minutes; It's not perfect, though, but it's HTTP legacy. Stateless protocol. Regards, Piotr. Dnia piątek 10 lipca 2009 o 14:46:28 Kuba Kucharski napisał(a): Hi, again how to list all currently logged users? If I have to make my own boolean column like logged_in in the user table how do I handle logout and expire? auth.settings.. ? not that easy ? I see onlogout here: http://mdp.cti.depaul.edu/examples/static/epydoc/web2py.gluon.tools2.Auth-c lass.html but what about handling expiry? --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26124] Re: override default model values in SQLFORM
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Please, do you have any advices? David Zejda napsal(a): Hello, I have table with a subject field, with default value specified in model. Now I would like to generate forms to add and update records. In the forms the default value specified in the model has to be overriden on certain conditions. I tried these: form.vars.subject = another default value form.custom.dspval.subject = another default value form.custom.inpval.subject = another default value But none of them works, still there are model default values pre-filled in the form fields. Please, could you help? Thanks in advance.. David -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkpXPrEACgkQ3oCkkciamVGzkACgo5qrBcRjdXm975QkirF85B9F qOAAoIaIojQTG4Jfx2bhdet7Hx0VzQMz =02Cn -END PGP SIGNATURE- --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26125] Re: latest sqlhtml.py breaks update function
Hans, What version where you using before (please spicy svn or bazaar/launchpad) ? I was using the sqlhtml file that came with the source code of web2py version 1.65.0. Can you (perhpas) try what version is still working: see eghttp://bazaar.launchpad.net/~mdipierro/web2py/devel/changes?filter_fi... (bazaar launchpad) I checked all versions of the sqlhtml.py file from 1005 upward, version 1012 is the last one that works, version 1013 breaks the update function, as does version 1014. Can you show some simple code that we can use to reproduce this? I wanted to update a record using the web2py's admin when I discovered that the update function no longer works, my own update functions call the update function: @auth.requires_membership('tier2_manager') def update_openinghour(): response.view='tier1/update.html' db.openingstijd.bedrijf.writable=False record=db.openingstijd[request.args[0]] if not record or not record.bedrijf==auth.user.bedrijf: redirect(URL(r=request,f='crud_openinghour')) form=update_form(db.openingstijd,record,'crud_openinghour') return dict(form=form) def update_form(table,rec,nxt): form=crud.update(table,rec,next=(URL(r=request,f=nxt))) form[0][-1][1].append(INPUT (_type='button',_value='Cancel',_onclick='javascript:history.go(-1)')) return form Kind regards, Annet. --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26126] Re: DAL remote control
There is no eval in DAL. Actually b) is safer. The overhead is negligible compared to the database IO times. You are doing the right thing On Jul 10, 1:55 am, rb rbspg...@gmail.com wrote: Thx for the speedy reply. Here's another question: 3) Because I'm doing a thick client, it creates db queries (SQL CRUD) which need to be communicated back to the controller which must query the db. The two ways to do this are: a) use a SQL statement within a executesql command, or b) create a DAL row selection criteria string and a column selection criteria string, send them back to the controller which feeds them through a python eval statement within a DAL function. It is always pointed out that b) is dangerous because it's possible for unintended string matter to get fed into the eval - which can reek havoc. However only *my* strings from the client which I have carefully massaged will ever be sent (e.g. I collect the column names from the db beforehand and provide them to the db().select(fieldnames- here) statement). Further, if I craft a SQL string then it too can suffer from bad input. I just have to be extra careful when creating the query strings. However if I use a) then I lose all of the functionality provided by the DAL. I've never been a fan of SQL and I'd like to avoid it in favour of what the DAL can offer. So I've implemented b) and it is working. My questions are: i) am I missing the obvious? Is there a much simpler/better way to do this? ii) does the DAL add much overhead? On Jul 9, 9:21 pm, mdipierro mdipie...@cs.depaul.edu wrote: On Jul 9, 11:04 pm, rb rbspg...@gmail.com wrote: Hi all, I'm using Web2py to serve a wxPython thick client via XMLRPC. I'm currently using SQLite (I like the zero db config ;-) and I have a few questions: 1) I have missed how to specify table constraints across several fields (in SQLite). For example, in a table the primary key consists of two fields - how do I specify that these two fields must comprise a UNIQUE value? In other dbs I could use executesql to just give the SQL commands, but SQLite (unless I'm mistaken) only allows table constraints within the CREATE TABLE SQL command. So can this be done in Web2py? You cannot create such constraint database side from web2py. Your options are: 1) enforce the constraint at the validators level 2) create the table outside web2py and set migrate=False 2) I'm confused as to which models get run when a controller is accessed. If I have db.py and uom.py models and I access the uom controller, what happens? From stepping thru the debugger I saw db.py get run first, then uom.py and then uom.py again (weird). I've simplified things down to just one (db.py) file for now, but I'm wondering if the infrastructure's intent is to run all model files upon each and every controller access. Oh, my access of the controller is via XMLRPC function (if that changes anything). All of them. Alphabetically. There has been some discussion on whether there should be exceptions to this rule. It would be easy to inplmenet but there was no consensus on whether an improvement was necessary. --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26127] Re: latest sqlhtml.py breaks update function
Hans, What version where you using before (please spicy svn or bazaar/launchpad) ? I was using the sqlhtml file that came with the source code of web2py version 1.65.0. Can you (perhpas) try what version is still working: see eghttp://bazaar.launchpad.net/~mdipierro/web2py/devel/changes?filter_fi... (bazaar launchpad) I checked all versions of the sqlhtml.py file from 1005 upward, version 1011 is the last one that works, version 1013 breaks the update function, as does version 1014. Can you show some simple code that we can use to reproduce this? I wanted to update a record using the web2py's admin when I discovered that the update function no longer works, my own update functions call the update function: @auth.requires_membership('tier2_manager') def update_openinghour(): response.view='tier1/update.html' db.openingstijd.bedrijf.writable=False record=db.openingstijd[request.args[0]] if not record or not record.bedrijf==auth.user.bedrijf: redirect(URL(r=request,f='crud_openinghour')) form=update_form(db.openingstijd,record,'crud_openinghour') return dict(form=form) def update_form(table,rec,nxt): form=crud.update(table,rec,next=(URL(r=request,f=nxt))) form[0][-1][1].append(INPUT (_type='button',_value='Cancel',_onclick='javascript:history.go (-1)')) return form Kind regards, Annet. --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26128] Re: override default model values in SQLFORM
David, 10 minutes after your original post there was already a reply: http://groups.google.com/group/web2py/browse_thread/thread/de36120b9337f00d/1fde78aa5827a84c?hl=enlnk=gstq=override+default+model+values+in+SQLFORM#1fde78aa5827a84c 2009/7/10 David Zejda d...@atlas.cz: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Please, do you have any advices? David Zejda napsal(a): Hello, I have table with a subject field, with default value specified in model. Now I would like to generate forms to add and update records. In the forms the default value specified in the model has to be overriden on certain conditions. I tried these: form.vars.subject = another default value form.custom.dspval.subject = another default value form.custom.inpval.subject = another default value But none of them works, still there are model default values pre-filled in the form fields. Please, could you help? Thanks in advance.. David -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkpXPrEACgkQ3oCkkciamVGzkACgo5qrBcRjdXm975QkirF85B9F qOAAoIaIojQTG4Jfx2bhdet7Hx0VzQMz =02Cn -END PGP SIGNATURE- --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26129] Re: Ruby 1.9 VS Python 3!!!
Pyhon 3 is probably the future but as of know the database drivers do not work with it. I also believe Python 3 is slower then Python 2.5-6. The main new features of Python 3 consists of default unicode strings and possibility to code in unicode (imagine function names with Chinese or Russian names). I disagree with Guido that this is a good idea. Allowing people to program in their alphabet will result in less exchange of code, not more and hard to read applications. At this point I see no reason to use Python 3.x, Massimo On Jul 10, 12:19 am, eric cs eeri...@gmail.com wrote: Thanks guys, So those books about Python 3.0, it's useless if I am planning to learn Web2py Python's version. Because they say: Python 3 is the best version of the language yet: It is more powerful, convenient, consistent, and expressive than ever before. Now, leading Python programmer Mark Summerfield demonstrates how to write code that takes full advantage of Python 3’s features and idioms. The first book written from a completely “Python 3” viewpoint, *Programming in Python 3 *brings together all the knowledge you need to write any program, use any standard or third-party Python 3 library, and create new library modules of your own. - Developing in Python using procedural, object-oriented, and functional programming paradigms - Creating custom packages and modules - Writing and reading binary, text, and XML files, including optional compression, random access, and text and XML parsing - Leveraging advanced data types, collections, control structures, and functions - Spreading program workloads across multiple processes and threads - Programming SQL databases and key-value DBM files - Utilizing Python’s regular expression mini-language and module - Building usable, efficient, GUI-based applications - Advanced programming techniques, including generators, function and class decorators, context managers, descriptors, abstract base classes, metaclasses, and more On Fri, Jul 10, 2009 at 12:45 AM, Yarko Tymciurak yark...@gmail.com wrote: Python 3 requires some code changes to applications. While these are not really great, the deal is (it seems always with major Python release changes) that it's easier to migrate an app than a framework - as (for example) web2py and django use mod_wsgi, all sorts of db backends, libraries, etc. When all those port and are stable and available, then the applications that use the various libraries from the Python community usually follow suite. Consider it will take something on the order of a year or so. BTW - the web2py code base itself is poised to run on Python 3, but until those other things are there (and tested) it wouldn't be terribly useful. On Thu, Jul 9, 2009 at 8:28 PM, eric cs eeri...@gmail.com wrote: Oh I was wondering why Web2py and Django are not using the last version of Python 3 as well. Thanks. On Jul 9, 9:11 pm, eric cs eeri...@gmail.com wrote: Hey guys, I am a newbie and Python and amazed by Web2py so I was wondering Can you compared them for me? As far as best features, closures,mixins and etc? Which one is easier to a newbie learn and why? I do know they look like each other but I saw some people saying Python is more mature than Ruby. Although Python and it's frameworks has much less books than Ruby and Rails. Some people like that because leaves Python on the underground...hackers...heheh Thanks. --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26130] Re: web2py based queue
You can use web2py cron and trigger the processing immediately after the action that queues the tasks returns. Massimo On Jul 10, 8:11 am, kralin andrea.pierle...@gmail.com wrote: I finally made it, at least for now. There is a database table where all the processes are stored, both to be processed and completed ones. db.define_table('work', SQLField('name','string'), SQLField('status','string'), SQLField('priority','integer'), SQLField('input','text'), SQLField('results','text'), SQLField ('date_submitted','datetime',default=datetime.datetime.now()), SQLField('date_completed','datetime'), ) than there is a cron that each minute look a the table and if there are jobs to process runs the first one. def process_job(): queue=db(db.work.status=='to be done').select (orderby=db.work.priority) if queue: job=queue[0] #do stuff like: input_string=job.input output_string='Procesed by cron worker : '+str(input_string) #submit results db.work[job.id]=dict (status='completed',results=output_string,date_completed=datetime.datetime.now ()) db.commit() return the problem with this is that I have to wait one minute for each table lookup, and that I'm not sure it will work correctly under WSGI, since I do not want to rely on system cron. The fastest improvement would be to run all the process in queue each time the controller is called by the cron, one by one, but I'm still convinced that using cron is not the best way to do this, even if it works. Am I the only one with this kind of issues? If not maybe I can post the solution to AlterEgo... On Jul 10, 3:19 am, mdipierro mdipie...@cs.depaul.edu wrote: You can use the databae as long the objects are serializable On Jul 9, 6:00 pm, kralin andrea.pierle...@gmail.com wrote: thanks massimo, very elegant... I have to check for the lock thing, otherwise a list is more tha sufficient for thequeue: queue=cache.ram('queue',lambda:[],10**10) queue.append(o) queue.pop(0) it should be also very easy to use a priority schedule by appending [int(priority), task] to thequeuelist. however I still need to cope with the guy that's going to do the heavy job. Is it possibile to set a Worker in web2py that is able to read the input from thequeueand put the results in a database, or do I have to launch a cron each minute to check for thequeue? On 10 Lug, 00:00, mdipierro mdipie...@cs.depaul.edu wrote: You can do something like classQueue: forever = 10**10 def __init__(self): import thread self.q=[] self.lock=thread.allocate_lock() def enque(self,o): self.lock.acquire() self.q.append(o) self.lock.release() def dequeue(self): self.lock.acquire() o = self.q[0] del q[0] self.lock.release() return o def __len__(self): self.lock.acquire() ell=len(self.q) self.lock.release() return ell queue=cache.ram('queue',lambda:Queue,Queue.forever) queue.enqueue('object') print len(queue) o =queue.dequeue() If you define it in a model it will be visible everywhere, including cron scripts. I am not sure if the lock is really necessary (because of the global interpreter lock) but it is safe. queue.append( On Jul 9, 4:07 pm, kralin andrea.pierle...@gmail.com wrote: Hi All, I'm diving into web2py that at the moment gives me the power and the time do a lot of cool things. so thanks a lot to you guys. I was wondering if any of you ever had the need to set aqueuefor a heavy process. Let's suppose I've got one heavy process that takes 2 mins to run on a singol-processor machine. now if 10 user submit the process at (more or less) the same time, is there a way to schedule the process based on the first coming, first to have response rule? each of this user should be able to see their result once completed or see something likewait, 8 jobs still in queue I know it can be done easily with external job sheduler, but it will require to use a separate process, not beeing portable, and a little bit more headhache... a quick and dirty solution wuld be to run a cron each, let's say, 2 mins and if a process isqueue, execute it, but I feel that can be done in a much more elegant way. what do youthink? --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to
[web2py:26131] Re: new chapters for the book CRUD and AUTH
On Tue, Jul 7, 2009 at 00:06, Alexandre Andradealexandrema...@gmail.com wrote: I think I good information to put in 'auth' section, besides the Renaming Auth tables is how translate auth tables fields: db.auth_user.first_name.label=T(First Name) etc. etc. I take some time to figure how get it. IDEA: I sugest, to make web2py more friendly to l10n, the labels was default as above, so we need only to translate xx-xx.py language file Really what we can do is use system I createad (class Messages) to do this on labels too (actually it only storage messages like 'Invalid email', 'Invalid login' etc.). I'll work on your idea too (really I was planning to - in new translation system these messages are inserted in lang files when it have to be translated the first time but is more interesting if we have it inserted by default). -- Álvaro Justen Peta5 - Telecomunicações e Software Livre 21 3021-6001 / 9898-0141 http://www.peta5.com.br/ --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26132] javascript function call from controller
Hi all, I have a javascript function in html file which is usually called from onclick event in the same file. It works fine. However I would like to call this javascript function from a controller. More precise description: after clicking an element in the page, the flow goes to controller. There I decide which dialog to display (I have it working to this point), but it is defined again in html file as jquery dialog opening with .dialog(open); How to do it? Julius --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26133] Re: ip of a logged-in-user
Hi, Yes, I've been there.. it generates a lot of updates :/ I thought maybe about some generic js solution already used by someone, we have dozens of very wise people here, sometimes they point me in the direction I've never even dreamt of ;) @speedbird I was trying to find this functionality in your great pyforum thing, but couldn't @all in the future, shouldn't this be implemented inside welcome app ? -- Kuba (pozdrowienia z Warszawy) --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26134] Re: dynamic css
Before you get too far into it, you might want to take a look at CleverCSS. (http://sandbox.pocoo.org/clevercss/). Might be able to incorporate it to save some time. On Jul 9, 5:06 pm, Jonathan Lundell jlund...@pobox.com wrote: On Jul 9, 2009, at 2:26 PM, Speedbird wrote: I'd say Safari's caching, it is known that safari does not handle changes in certain type of files very well (a feature or a nuisance, who knows).. Anyway, read here for more info:http://forums.macrumors.com/showthread.php?t=73360 It wasn't caching; I could see the proper file content via Safari's inspect-element function. It turned out that I had to override the content-type to be text/css. I *am* going to have to deal with caching, though. As a dynamic page, it's specifying no caching at all, which is not what you really want for css. -- Julio On Jul 9, 2:16 pm, Jonathan Lundell jlund...@pobox.com wrote: I'd like to generate my CSS dynamically, using web2py's views syntax (mainly for macro substitution, dynamic substitution of colors, stuff like that). So I created a controller named css, with a method called base, and a view named base.css. I then changed layout html to ask for /app/css/ base.css for its stylesheet. Miraculously, everything works: except that my browser (Safari 4.0.2) won't use the resulting stylesheet, even though, near as I can tell, it looks fine. Any suggestions? --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26135] Re: web2py based queue
I'm actually using the web2py cron. Is there a way I can launch the cron external process by the action, without waiting for the 60 seconds? On Jul 10, 3:30 pm, mdipierro mdipie...@cs.depaul.edu wrote: You can use web2py cron and trigger the processing immediately after the action that queues the tasks returns. Massimo On Jul 10, 8:11 am, kralin andrea.pierle...@gmail.com wrote: I finally made it, at least for now. There is a database table where all the processes are stored, both to be processed and completed ones. db.define_table('work', SQLField('name','string'), SQLField('status','string'), SQLField('priority','integer'), SQLField('input','text'), SQLField('results','text'), SQLField ('date_submitted','datetime',default=datetime.datetime.now()), SQLField('date_completed','datetime'), ) than there is a cron that each minute look a the table and if there are jobs to process runs the first one. def process_job(): queue=db(db.work.status=='to be done').select (orderby=db.work.priority) ifqueue: job=queue[0] #do stuff like: input_string=job.input output_string='Procesed by cron worker : '+str(input_string) #submit results db.work[job.id]=dict (status='completed',results=output_string,date_completed=datetime.datetime.now ()) db.commit() return the problem with this is that I have to wait one minute for each table lookup, and that I'm not sure it will work correctly under WSGI, since I do not want to rely on system cron. The fastest improvement would be to run all the process inqueueeach time the controller is called by the cron, one by one, but I'm still convinced that using cron is not the best way to do this, even if it works. Am I the only one with this kind of issues? If not maybe I can post the solution to AlterEgo... On Jul 10, 3:19 am, mdipierro mdipie...@cs.depaul.edu wrote: You can use the databae as long the objects are serializable On Jul 9, 6:00 pm, kralin andrea.pierle...@gmail.com wrote: thanks massimo, very elegant... I have to check for the lock thing, otherwise a list is more tha sufficient for thequeue: queue=cache.ram('queue',lambda:[],10**10) queue.append(o) queue.pop(0) it should be also very easy to use a priority schedule by appending [int(priority), task] to thequeuelist. however I still need to cope with the guy that's going to do the heavy job. Is it possibile to set a Worker in web2py that is able to read the input from thequeueand put the results in a database, or do I have to launch a cron each minute to check for thequeue? On 10 Lug, 00:00, mdipierro mdipie...@cs.depaul.edu wrote: You can do something like classQueue: forever = 10**10 def __init__(self): import thread self.q=[] self.lock=thread.allocate_lock() def enque(self,o): self.lock.acquire() self.q.append(o) self.lock.release() def dequeue(self): self.lock.acquire() o = self.q[0] del q[0] self.lock.release() return o def __len__(self): self.lock.acquire() ell=len(self.q) self.lock.release() return ell queue=cache.ram('queue',lambda:Queue,Queue.forever) queue.enqueue('object') print len(queue) o =queue.dequeue() If you define it in a model it will be visible everywhere, including cron scripts. I am not sure if the lock is really necessary (because of the global interpreter lock) but it is safe. queue.append( On Jul 9, 4:07 pm, kralin andrea.pierle...@gmail.com wrote: Hi All, I'm diving into web2py that at the moment gives me the power and the time do a lot of cool things. so thanks a lot to you guys. I was wondering if any of you ever had the need to set aqueuefor a heavy process. Let's suppose I've got one heavy process that takes 2 mins to run on a singol-processor machine. now if 10 user submit the process at (more or less) the same time, is there a way to schedule the process based on the first coming, first to have response rule? each of this user should be able to see their result once completed or see something likewait, 8 jobs still in queue I know it can be done easily with external job sheduler, but it will require to use a separate process, not beeing portable, and a little bit more headhache... a quick and dirty solution wuld be to run a cron each, let's say, 2 mins and if a process isqueue, execute it, but I feel that can be done in a much more
[web2py:26136] ip of a logged-in-user
it generates a lot of updates :/ I described solution used by Invision Power Board and other forum engines :) But, hmm, maybe their solutions are a bit more complicated (PHP, poo!). Sincerely, Piotr. (okolice Oświęcimia również pozdrawiają :] ) --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26138] Re: javascript function call from controller
With the latest trunk you can do intput name=value id=value / button onclick=ajax('callback',['value'],':eval')click me/button div id=target/div def callback(): value=request.vars.value return jQuery('#target').html(%s) % repr(str(value)) when you click the button it sends the value of value to the callback function. The function returns a jQuery string and the clients runs it. The trick here is ajax(...,':eval') which is defined by web2py. On Jul 10, 8:56 am, Julius Minka j...@minka.sk wrote: Hi all, I have a javascript function in html file which is usually called from onclick event in the same file. It works fine. However I would like to call this javascript function from a controller. More precise description: after clicking an element in the page, the flow goes to controller. There I decide which dialog to display (I have it working to this point), but it is defined again in html file as jquery dialog opening with .dialog(open); How to do it? Julius --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26139] What about backward compatibility?
Hi guys. This message is more about policy rather than technology, ok? I am new to web2py and did not develop anything with it, yet. I just read some docs, watched some slides and video tutorials. As as newcomer Django user too, I could see some changing behaviour between versions before 1.0. And who can guarantee me it won't happen after it? Nobody. I don't see some care about backward compatibility in Django. What's web2py commitment with backward compatibility? If I develop code, this code will turn into legacy code in the very moment it's in production, right? And some of the worse things on working with customers, is answering something like: OK, I can make the change you are asking me. But I'll have to charge an extra bit due to 'technology update'. My customer doesn't care about it. And he really doesn't have to. It's my profession. Not his, right? Consequently, as a professional, I care about maximizing my own time investment on learning and using languages and frameworks. As a mainframe professional for 21 years long, even today I am allowed to run some programs I developed in my early days on IBM MVS operating system (I'm talking about 1988!). With no change at all. Such environment is very stable, despite of language evolution. Yes, languages change there, too. But it's always backward compatible. It's about maximizing time and money. Is there anywhere written about it in web2py documentation or website? I've not found it, yet. IMHO it's one of the most important issues when some company chooses some technology to use. I am not talking about compatiblity among python versions. I know it's not a web2py issue, but python's. I'm referring about compatibility among web2py versions, itself. -- [ ]s Vinicius Assef. --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26140] Re: What about backward compatibility?
On Jul 10, 9:12 am, Vinicius Assef vinicius...@gmail.com wrote: Hi guys. This message is more about policy rather than technology, ok? I am new to web2py and did not develop anything with it, yet. I just read some docs, watched some slides and video tutorials. As as newcomer Django user too, I could see some changing behaviour between versions before 1.0. And who can guarantee me it won't happen after it? Nobody. I don't see some care about backward compatibility in Django. What's web2py commitment with backward compatibility? We are fully committed to backward compatiliby. We never broke it in 2 years. We do not accept patches that break it. That is one of the reason we call web2py an Enterprise framework. I thought we said that in the main web page but somehow it disappeared in the last edit. I will put it back. If I develop code, this code will turn into legacy code in the very moment it's in production, right? And some of the worse things on working with customers, is answering something like: OK, I can make the change you are asking me. But I'll have to charge an extra bit due to 'technology update'. My customer doesn't care about it. And he really doesn't have to. It's my profession. Not his, right? Consequently, as a professional, I care about maximizing my own time investment on learning and using languages and frameworks. As a mainframe professional for 21 years long, even today I am allowed to run some programs I developed in my early days on IBM MVS operating system (I'm talking about 1988!). With no change at all. Such environment is very stable, despite of language evolution. Yes, languages change there, too. But it's always backward compatible. It's about maximizing time and money. Is there anywhere written about it in web2py documentation or website? I've not found it, yet. IMHO it's one of the most important issues when some company chooses some technology to use. I am not talking about compatiblity among python versions. I know it's not a web2py issue, but python's. I'm referring about compatibility among web2py versions, itself. -- [ ]s Vinicius Assef. --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26141] Re: javascript function call from controller
JohnMc, decision is made based on data in db related to current screen. Julius JohnMc wrote / napísal(a): Julius, Unless you are performing a server side lookup why not decide the dialog to present using a clientside if or switch in javascript? On Jul 10, 8:56 am, Julius Minka j...@minka.sk wrote: Hi all, I have a javascript function in html file which is usually called from onclick event in the same file. It works fine. However I would like to call this javascript function from a controller. More precise description: after clicking an element in the page, the flow goes to controller. There I decide which dialog to display (I have it working to this point), but it is defined again in html file as jquery dialog opening with .dialog(open); How to do it? Julius --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26142] Re: What about backward compatibility?
On Jul 10, 11:26 am, mdipierro mdipie...@cs.depaul.edu wrote: On Jul 10, 9:12 am, Vinicius Assef vinicius...@gmail.com wrote: What's web2py commitment with backward compatibility? We are fully committed to backward compatiliby. We never broke it in 2 years. We do not accept patches that break it. That is one of the reason we call web2py an Enterprise framework. I thought we said that in the main web page but somehow it disappeared in the last edit. I will put it back. Massimo, thank you for your immediate answer. I think it is a common shortcomming to companies when they choose to adopt new technologies. When a big company takes care of some peace of software, i.e, IBM, customers know this is on way. But, actually, this is not web2py's situation, right? I would put it in web2py homepage and I'd enphasize it. With all capital letters, colorful, and blinking! (just a joke) Just saying enterprise framework, can mean able to work with large teams, or good methods, or distributed teams, maybe rapid development, even stardards compliant, but not backward compatible. I'd also say there what you wrote: We never broke it in 2 years. It's worth reading. :-) Backward compatibility is very, very important. Really. I've worked to big telecom companies, here in Brazil, and this topic was decisive to make some choices. Frequently, money was not the problem. Lifetime cicle was. Despite technology or simplicity. Congratulations. +1 point to web2py. ;-) -- [ ]s Vinicius Assef. --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26143] Re: dynamic css
On Jul 10, 2009, at 7:03 AM, JohnMc wrote: Before you get too far into it, you might want to take a look at CleverCSS. (http://sandbox.pocoo.org/clevercss/). Might be able to incorporate it to save some time. Nice, but I'm not sure it's compelling. And you'd still need to serve up a dynamic CSS file. My needs aren't all that complex, basically a macro facility for controlling colors and fonts without having to do a big search replace. The native CSS way to do this is (for example): h1,h2,h3,h4,.headerclass { font-family: some header fonts; } h1 { the rest of h1 } h2 { the rest of h2 } etc But in a big file this gets to be very confusing, with definitions fragmented all over the place. So if I define the font family either as {{variables}} at the front of the file or in the controller, I can use: h1 { {{header_font_family}} } or the like. The nice thing about the web2py setup is that the whole mechanism is already available and well-known--nothing new to learn. For the record, here's what I ended up with. I made a controller called 'css' containing code like this, one method per css file (nothing in the dict yet, but that might be a good way to communicate my css parameters): def base(): response.headers['Content-Type']='text/css' this was the necessary trick return dict() There's a corresponding view called css/base.css (no embedded code yet; other than that, it's just a stock CSS file): body { font-family: Verdana, sans-serif; } div.beautify td { padding-top: 0; } Then in layout.html, instead of: link rel=stylesheet media=screen,projection type=text/css href={{=URL(request.application,'static','base.css')}} / we have: link rel=stylesheet media=screen,projection type=text/css href={{=URL(request.application,'css','base.css')}} / That's all there is to it, with one exception that I haven't worked out yet: the dynamic file is marked as uncached, and that's pretty inefficient for CSS if your CSS isn't really dynamic page-to-page, which mine is not. I'm assuming that I can edit the response headers to specify a ttl. But that's an optimization, and not needed for functionality. I could imagine that web2py might want to do this automatically, and adjust the default response headers based on the .css extension of the view. --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26144] Re: web2py based queue
I know there is but I do not recall how. Achipa wrote this. pehaps he can enlighten us. On Jul 10, 9:07 am, kralin andrea.pierle...@gmail.com wrote: I'm actually using the web2py cron. Is there a way I can launch the cron external process by the action, without waiting for the 60 seconds? On Jul 10, 3:30 pm, mdipierro mdipie...@cs.depaul.edu wrote: You can use web2py cron and trigger the processing immediately after the action that queues the tasks returns. Massimo On Jul 10, 8:11 am, kralin andrea.pierle...@gmail.com wrote: I finally made it, at least for now. There is a database table where all the processes are stored, both to be processed and completed ones. db.define_table('work', SQLField('name','string'), SQLField('status','string'), SQLField('priority','integer'), SQLField('input','text'), SQLField('results','text'), SQLField ('date_submitted','datetime',default=datetime.datetime.now()), SQLField('date_completed','datetime'), ) than there is a cron that each minute look a the table and if there are jobs to process runs the first one. def process_job(): queue=db(db.work.status=='to be done').select (orderby=db.work.priority) ifqueue: job=queue[0] #do stuff like: input_string=job.input output_string='Procesed by cron worker : '+str(input_string) #submit results db.work[job.id]=dict (status='completed',results=output_string,date_completed=datetime.datetime.now ()) db.commit() return the problem with this is that I have to wait one minute for each table lookup, and that I'm not sure it will work correctly under WSGI, since I do not want to rely on system cron. The fastest improvement would be to run all the process inqueueeach time the controller is called by the cron, one by one, but I'm still convinced that using cron is not the best way to do this, even if it works. Am I the only one with this kind of issues? If not maybe I can post the solution to AlterEgo... On Jul 10, 3:19 am, mdipierro mdipie...@cs.depaul.edu wrote: You can use the databae as long the objects are serializable On Jul 9, 6:00 pm, kralin andrea.pierle...@gmail.com wrote: thanks massimo, very elegant... I have to check for the lock thing, otherwise a list is more tha sufficient for thequeue: queue=cache.ram('queue',lambda:[],10**10) queue.append(o) queue.pop(0) it should be also very easy to use a priority schedule by appending [int(priority), task] to thequeuelist. however I still need to cope with the guy that's going to do the heavy job. Is it possibile to set a Worker in web2py that is able to read the input from thequeueand put the results in a database, or do I have to launch a cron each minute to check for thequeue? On 10 Lug, 00:00, mdipierro mdipie...@cs.depaul.edu wrote: You can do something like classQueue: forever = 10**10 def __init__(self): import thread self.q=[] self.lock=thread.allocate_lock() def enque(self,o): self.lock.acquire() self.q.append(o) self.lock.release() def dequeue(self): self.lock.acquire() o = self.q[0] del q[0] self.lock.release() return o def __len__(self): self.lock.acquire() ell=len(self.q) self.lock.release() return ell queue=cache.ram('queue',lambda:Queue,Queue.forever) queue.enqueue('object') print len(queue) o =queue.dequeue() If you define it in a model it will be visible everywhere, including cron scripts. I am not sure if the lock is really necessary (because of the global interpreter lock) but it is safe. queue.append( On Jul 9, 4:07 pm, kralin andrea.pierle...@gmail.com wrote: Hi All, I'm diving into web2py that at the moment gives me the power and the time do a lot of cool things. so thanks a lot to you guys. I was wondering if any of you ever had the need to set aqueuefor a heavy process. Let's suppose I've got one heavy process that takes 2 mins to run on a singol-processor machine. now if 10 user submit the process at (more or less) the same time, is there a way to schedule the process based on the first coming, first to have response rule? each of this user should be able to see their result once completed or see something likewait, 8 jobs still in queue I know it can be done easily with external job sheduler, but it
[web2py:26145] Re: Upload with previously used but removed applicationname
Problem was that in web2py/deposit/ there was the ips.w2p file with owner root rather than the web2py user...maybe through manual copy... changed owner and now its working like it should. Thanks Massimo for pointing me into the right folder! On Jul 9, 10:47 pm, mdipierro mdipie...@cs.depaul.edu wrote: odd. tehcnically uploaded files go in web2py/deposit/ before being unpacked On Jul 9, 2:39 pm, Hans johann.scheibelho...@easytouch-edv.com wrote: This has low priority for me because of possible workaround below - don't spend much time on this. I use pack-all on a windows development pc and try to upload the ips.w2p on the ubuntu production server (after having used uninstall 'ips'). all in web2py admin/default/site web interface. when I upload the file with the same name (rename it field 'ips') then I get a flash response: unable to install ips. uploading the same file with another name (like 'xps') works. so I just go on linux shell and rename it e.g. mv ./xps ./ips to work around the problem. the folder ips does not exist on linux any more after the uninstall via admin interface. also changing the name of the file ips.w2p does not make a difference. are (old) application names in web2py stored somewhere else too? any other idea? both systems are on web2py 1.65.1 development on win XP production on ubuntu Hans --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26146] Re: What about backward compatibility?
OK. check out web2py.com, the second item after the slides. On Jul 10, 10:02 am, viniciusban vinicius...@gmail.com wrote: On Jul 10, 11:26 am, mdipierro mdipie...@cs.depaul.edu wrote: On Jul 10, 9:12 am, Vinicius Assef vinicius...@gmail.com wrote: What's web2py commitment with backward compatibility? We are fully committed to backward compatiliby. We never broke it in 2 years. We do not accept patches that break it. That is one of the reason we call web2py an Enterprise framework. I thought we said that in the main web page but somehow it disappeared in the last edit. I will put it back. Massimo, thank you for your immediate answer. I think it is a common shortcomming to companies when they choose to adopt new technologies. When a big company takes care of some peace of software, i.e, IBM, customers know this is on way. But, actually, this is not web2py's situation, right? I would put it in web2py homepage and I'd enphasize it. With all capital letters, colorful, and blinking! (just a joke) Just saying enterprise framework, can mean able to work with large teams, or good methods, or distributed teams, maybe rapid development, even stardards compliant, but not backward compatible. I'd also say there what you wrote: We never broke it in 2 years. It's worth reading. :-) Backward compatibility is very, very important. Really. I've worked to big telecom companies, here in Brazil, and this topic was decisive to make some choices. Frequently, money was not the problem. Lifetime cicle was. Despite technology or simplicity. Congratulations. +1 point to web2py. ;-) -- [ ]s Vinicius Assef. --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26147] Re: web2py based queue
You could try something like this - not too clean but, good for kicking off async tasks in another thread after the page has been served. import gluon.contrib.wsgihooks as wsgihooks class myasynctask(wsgihooks.PostConnectionTask): def __init__(self): wsgihooks.PostConnectionTask.__init__(self) def run(self): my_call_start_queue() def my_controller(): do_other_stuff() wsgihooks.localposttasks.append (myasynctask()) return dict(myresult='myresult') Note that if your web server kills processes that work too long you'll have to increase the timeout. On Jul 10, 4:07 pm, kralin andrea.pierle...@gmail.com wrote: I'm actually using the web2py cron. Is there a way I can launch the cron external process by the action, without waiting for the 60 seconds? On Jul 10, 3:30 pm, mdipierro mdipie...@cs.depaul.edu wrote: You can use web2py cron and trigger the processing immediately after the action that queues the tasks returns. Massimo On Jul 10, 8:11 am, kralin andrea.pierle...@gmail.com wrote: I finally made it, at least for now. There is a database table where all the processes are stored, both to be processed and completed ones. db.define_table('work', SQLField('name','string'), SQLField('status','string'), SQLField('priority','integer'), SQLField('input','text'), SQLField('results','text'), SQLField ('date_submitted','datetime',default=datetime.datetime.now()), SQLField('date_completed','datetime'), ) than there is a cron that each minute look a the table and if there are jobs to process runs the first one. def process_job(): queue=db(db.work.status=='to be done').select (orderby=db.work.priority) ifqueue: job=queue[0] #do stuff like: input_string=job.input output_string='Procesed by cron worker : '+str(input_string) #submit results db.work[job.id]=dict (status='completed',results=output_string,date_completed=datetime.datetime.now ()) db.commit() return the problem with this is that I have to wait one minute for each table lookup, and that I'm not sure it will work correctly under WSGI, since I do not want to rely on system cron. The fastest improvement would be to run all the process inqueueeach time the controller is called by the cron, one by one, but I'm still convinced that using cron is not the best way to do this, even if it works. Am I the only one with this kind of issues? If not maybe I can post the solution to AlterEgo... On Jul 10, 3:19 am, mdipierro mdipie...@cs.depaul.edu wrote: You can use the databae as long the objects are serializable On Jul 9, 6:00 pm, kralin andrea.pierle...@gmail.com wrote: thanks massimo, very elegant... I have to check for the lock thing, otherwise a list is more tha sufficient for thequeue: queue=cache.ram('queue',lambda:[],10**10) queue.append(o) queue.pop(0) it should be also very easy to use a priority schedule by appending [int(priority), task] to thequeuelist. however I still need to cope with the guy that's going to do the heavy job. Is it possibile to set a Worker in web2py that is able to read the input from thequeueand put the results in a database, or do I have to launch a cron each minute to check for thequeue? On 10 Lug, 00:00, mdipierro mdipie...@cs.depaul.edu wrote: You can do something like classQueue: forever = 10**10 def __init__(self): import thread self.q=[] self.lock=thread.allocate_lock() def enque(self,o): self.lock.acquire() self.q.append(o) self.lock.release() def dequeue(self): self.lock.acquire() o = self.q[0] del q[0] self.lock.release() return o def __len__(self): self.lock.acquire() ell=len(self.q) self.lock.release() return ell queue=cache.ram('queue',lambda:Queue,Queue.forever) queue.enqueue('object') print len(queue) o =queue.dequeue() If you define it in a model it will be visible everywhere, including cron scripts. I am not sure if the lock is really necessary (because of the global interpreter lock) but it is safe. queue.append( On Jul 9, 4:07 pm, kralin andrea.pierle...@gmail.com wrote: Hi All, I'm diving into web2py that at the moment gives me the power and the time do a lot of cool things. so thanks a lot to you guys. I was wondering if any of you ever had the need to set aqueuefor a heavy process.
[web2py:26148] Re: dynamic css
On Fri, Jul 10, 2009 at 12:14, Jonathan Lundelljlund...@pobox.com wrote: On Jul 10, 2009, at 7:03 AM, JohnMc wrote: Before you get too far into it, you might want to take a look at CleverCSS. (http://sandbox.pocoo.org/clevercss/). Might be able to incorporate it to save some time. Nice, but I'm not sure it's compelling. And you'd still need to serve up a dynamic CSS file. My needs aren't all that complex, basically a macro facility for controlling colors and fonts without having to do a big search replace. The native CSS way to do this is (for example): h1,h2,h3,h4,.headerclass { font-family: some header fonts; } h1 { the rest of h1 } h2 { the rest of h2 } etc But in a big file this gets to be very confusing, with definitions fragmented all over the place. So if I define the font family either as {{variables}} at the front of the file or in the controller, I can use: h1 { {{header_font_family}} } or the like. The nice thing about the web2py setup is that the whole mechanism is already available and well-known--nothing new to learn. For the record, here's what I ended up with. I made a controller called 'css' containing code like this, one method per css file (nothing in the dict yet, but that might be a good way to communicate my css parameters): def base(): response.headers['Content-Type']='text/css' this was the necessary trick return dict() There's a corresponding view called css/base.css (no embedded code yet; other than that, it's just a stock CSS file): body { font-family: Verdana, sans-serif; } div.beautify td { padding-top: 0; } Then in layout.html, instead of: link rel=stylesheet media=screen,projection type=text/css href={{=URL(request.application,'static','base.css')}} / we have: link rel=stylesheet media=screen,projection type=text/css href={{=URL(request.application,'css','base.css')}} / That's all there is to it, with one exception that I haven't worked out yet: the dynamic file is marked as uncached, and that's pretty inefficient for CSS if your CSS isn't really dynamic page-to-page, which mine is not. I'm assuming that I can edit the response headers to specify a ttl. But that's an optimization, and not needed for functionality. I could imagine that web2py might want to do this automatically, and adjust the default response headers based on the .css extension of the view. You can test setting HTTP header Pragma to 'no-cache' as W3C says[1] or if you are suspecting that web2py is setting headers in a way you don't want you could view headers (using Firefox addon Live HTTP Headers, wget etc.) to make sure it's ok. An example: code alv...@estavel:~$ wget --server-response http://localhost:8000 --2009-07-10 12:40:16-- http://localhost:8000/ Resolving localhost... 127.0.0.1 Connecting to localhost|127.0.0.1|:8000... connected. HTTP request sent, awaiting response... HTTP/1.1 303 SEE OTHER Content-Type: text/html; charset=UTF-8 Location: /welcome/default/index Date: Fri, 10 Jul 2009 15:40:16 GMT Server: CherryPy/3.1.0beta3 WSGI Server Location: /welcome/default/index [following] --2009-07-10 12:40:16-- http://localhost:8000/welcome/default/index Connecting to localhost|127.0.0.1|:8000... connected. HTTP request sent, awaiting response... HTTP/1.1 200 OK Set-Cookie: session_id_welcome=127-0-0-1-def969db-1334-4a49-80cc-5125fa524cf3; Path=/ Expires: Fri, 10 Jul 2009 15:40:16 GMT Content-Type: text/html; charset=UTF-8 Pragma: no-cache Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Date: Fri, 10 Jul 2009 15:40:16 GMT Server: CherryPy/3.1.0beta3 WSGI Server Length: unspecified [text/html] Saving to: `index' [ = ] 5,236 --.-K/s in 0s 2009-07-10 12:40:16 (150 MB/s) - `index' saved [5236] alv...@estavel:~$ /code When I want to avoid browser's features that I can't control or don't know how works I simply get page with wget: it is simple and do eactly what I want. :-) [1] http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.32 -- Álvaro Justen Peta5 - Telecomunicações e Software Livre 21 3021-6001 / 9898-0141 http://www.peta5.com.br/ --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26149] Re: dynamic css
On Jul 10, 2009, at 8:43 AM, Álvaro Justen [Turicas] wrote: You can test setting HTTP header Pragma to 'no-cache' as W3C says[1] or if you are suspecting that web2py is setting headers in a way you don't want you could view headers (using Firefox addon Live HTTP Headers, wget etc.) to make sure it's ok. An example: I've been using curl -i (include headers) or -I (headers only). Here's the static css file: HTTP/1.1 200 OK Content-Length: 8861 Last-Modified: Sat, 04 Jul 2009 20:17:11 GMT Pragma: cache Cache-Control: private Content-Type: text/css Date: Thu, 09 Jul 2009 21:58:11 GMT Server: CherryPy/3.1.0beta3 WSGI Server Here's the dynamic one (a different file, though, and via Apache; the interesting part is the caching): HTTP/1.1 200 OK Date: Fri, 10 Jul 2009 16:02:50 GMT Expires: Fri, 10 Jul 2009 16:02:50 GMT Pragma: no-cache Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre- check=0 Content-Length: 84 Content-Type: text/css --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26151] Re: dynamic css
On Fri, Jul 10, 2009 at 13:05, Jonathan Lundelljlund...@pobox.com wrote: On Jul 10, 2009, at 8:43 AM, Álvaro Justen [Turicas] wrote: You can test setting HTTP header Pragma to 'no-cache' as W3C says[1] or if you are suspecting that web2py is setting headers in a way you don't want you could view headers (using Firefox addon Live HTTP Headers, wget etc.) to make sure it's ok. An example: I've been using curl -i (include headers) or -I (headers only). Here's the static css file: HTTP/1.1 200 OK Content-Length: 8861 Last-Modified: Sat, 04 Jul 2009 20:17:11 GMT Pragma: cache Cache-Control: private Content-Type: text/css Date: Thu, 09 Jul 2009 21:58:11 GMT Server: CherryPy/3.1.0beta3 WSGI Server Here's the dynamic one (a different file, though, and via Apache; the interesting part is the caching): HTTP/1.1 200 OK Date: Fri, 10 Jul 2009 16:02:50 GMT Expires: Fri, 10 Jul 2009 16:02:50 GMT Pragma: no-cache Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre- check=0 Content-Length: 84 Content-Type: text/css 1- When you download dynamic file from cURL you get it correctly (changed as you want)? It generates a ticket? 2- You can change URL of stylesheet so if your browser are doing cache it won't work for new file. Change 'def base' do 'def testing_css' and change call to this in layout.html. 3- The dynamic CSS is valid through W3C validator[1]? [1] http://validator.w3.org/ -- Álvaro Justen Peta5 - Telecomunicações e Software Livre 21 3021-6001 / 9898-0141 http://www.peta5.com.br/ --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26150] Re: What about backward compatibility?
On Jul 10, 12:29 pm, mdipierro mdipie...@cs.depaul.edu wrote: OK. check out web2py.com, the second item after the slides. Nice! And so quick. :-) -- [ ]s Vinicius Assef. --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26152] Sending a welcome message but not a cofirm message...
Is there a way with auth to send a welcome message when people register? Regards, JAson --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26153] Re: eStore appliance
Hey, I just happen to have been playing around both with estore and with the Paypal Engine that Matt did. (I have the same problem you do, UK is the only country that gets some of googles love in europe, the rest go way behind, so no google checkout here either). Actually Google checkout works only in US, UK (and Canada maybe, if I recall correctly) Anyways, the Engine that Matt did, does NVP, which allows you to integrate Paypal to a different level than most people probably need (which is much more simmilar to what Massimo has on his EStore app). Right now on the Engine that Matt did, you only have the DoDirectPayment already setup (which is to process the data of a transaction for which you hold all the customers data including credit card etc). If you need to do the whole checkout with Paypal with NVP, its a longer process, if I remember ok, you actually first stablish a connection, then you get a token from paypal validating it, you redirect to a URL with that token, then then you get the validation of all the data from the customer, then you process your cart confirming the sale, and get another response giving you the data you would need to show the customer the receipt... its something like this. However, there is a very simple way to set it up that works almost exactly like what Massimo shows for google. I am just in the process of modifying EStore to put it in place in a very simplified way, but I am sure you can take it up from there to do whatever you want. I'll send it to Massimo if its ok, as I am building a bit over his code, and would rather he posts it if he feels its ok. I'll try to have it by next monday. Cheers, Benigno. On 4 jul, 06:20, suiato homm...@gmail.com wrote: just restarted to work on eStore yesterday, trying to use it as a reference for one of my projects. it's a good and useful example for me to learn translation and system in web2py. Google checkout for merchants is still not available in countries other than US and UK, though its application pages now appear here in Japanese... Found an appliancePayPalEngine by Matt Sellers athttp://mdp.cti.depaul.edu/appliances. Could be integrated into eStore? eStore may be old and need a lot of work to be a full-fledged e- commerce appliance. It'd be nice to have it that way, but there's another interest in removing fluffy parts and trimming down to its skeleton. This way, logics will be revealed more clearly, easy to understand the structure, and easy to extend it as necessary. Dreaming a dream of the skeletal eStore to be applied to various devices like iPhone, mobiles, PDA and others without changing its logical core... -- Teru On 7月4日, 午前1:41, mdipierro mdipie...@cs.depaul.edu wrote: eStoreis now an old app. It needs lots of work. Massimo On Jul 3, 11:36 am, mingodad mingo...@gmail.com wrote: I was caught too by the error messages too small or too large I sugest to add the folowing to the css part on layout.html: .error { background-color: red; color: white; padding: 3px } It was borroed from T3, this way the error messages will not pass unnoticed. As well I'm intrigged why the *_bc fields doesn't get the default values like the others ! --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26154] Re: Sending a welcome message but not a cofirm message...
def welcome(form): auth.settings.mailer.sent(to=form.vars.email,message='Hello %s' % form.vars.first_name) auth.settings.register_onaccept = welcome Need to add this to the book. Thanks for the reminder. Massimo On Jul 10, 2:25 pm, Jason Brower encomp...@gmail.com wrote: Is there a way with auth to send a welcome message when people register? Regards, JAson --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26155] auth_add_permission()
auth_add_permission() (and its brethren) accept a record_id, or 0 for a whole table. I'm wondering whether it'd be practical to extend that to specify a horizontal slice of a table, perhaps defined by the value of a field, or more generally a select. And even more generally, a set of fields from that set of rows. --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26156] Re: web2py based queue
thanks a lot AchipA! On Jul 10, 5:33 pm, AchipA attila.cs...@gmail.com wrote: You could try something like this - not too clean but, good for kicking off async tasks in another thread after the page has been served. import gluon.contrib.wsgihooks as wsgihooks class myasynctask(wsgihooks.PostConnectionTask): def __init__(self): wsgihooks.PostConnectionTask.__init__(self) def run(self): my_call_start_queue() def my_controller(): do_other_stuff() wsgihooks.localposttasks.append (myasynctask()) return dict(myresult='myresult') Note that if your web server kills processes that work too long you'll have to increase the timeout. On Jul 10, 4:07 pm, kralin andrea.pierle...@gmail.com wrote: I'm actually using the web2py cron. Is there a way I can launch the cron external process by the action, without waiting for the 60 seconds? On Jul 10, 3:30 pm, mdipierro mdipie...@cs.depaul.edu wrote: You can use web2py cron and trigger the processing immediately after the action that queues the tasks returns. Massimo On Jul 10, 8:11 am, kralin andrea.pierle...@gmail.com wrote: I finally made it, at least for now. There is a database table where all the processes are stored, both to be processed and completed ones. db.define_table('work', SQLField('name','string'), SQLField('status','string'), SQLField('priority','integer'), SQLField('input','text'), SQLField('results','text'), SQLField ('date_submitted','datetime',default=datetime.datetime.now()), SQLField('date_completed','datetime'), ) than there is a cron that each minute look a the table and if there are jobs to process runs the first one. def process_job(): queue=db(db.work.status=='to be done').select (orderby=db.work.priority) ifqueue: job=queue[0] #do stuff like: input_string=job.input output_string='Procesed by cron worker : '+str(input_string) #submit results db.work[job.id]=dict (status='completed',results=output_string,date_completed=datetime.datetime.now ()) db.commit() return the problem with this is that I have to wait one minute for each table lookup, and that I'm not sure it will work correctly under WSGI, since I do not want to rely on system cron. The fastest improvement would be to run all the process inqueueeach time the controller is called by the cron, one by one, but I'm still convinced that using cron is not the best way to do this, even if it works. Am I the only one with this kind of issues? If not maybe I can post the solution to AlterEgo... On Jul 10, 3:19 am, mdipierro mdipie...@cs.depaul.edu wrote: You can use the databae as long the objects are serializable On Jul 9, 6:00 pm, kralin andrea.pierle...@gmail.com wrote: thanks massimo, very elegant... I have to check for the lock thing, otherwise a list is more tha sufficient for thequeue: queue=cache.ram('queue',lambda:[],10**10) queue.append(o) queue.pop(0) it should be also very easy to use a priority schedule by appending [int(priority), task] to thequeuelist. however I still need to cope with the guy that's going to do the heavy job. Is it possibile to set a Worker in web2py that is able to read the input from thequeueand put the results in a database, or do I have to launch a cron each minute to check for thequeue? On 10 Lug, 00:00, mdipierro mdipie...@cs.depaul.edu wrote: You can do something like classQueue: forever = 10**10 def __init__(self): import thread self.q=[] self.lock=thread.allocate_lock() def enque(self,o): self.lock.acquire() self.q.append(o) self.lock.release() def dequeue(self): self.lock.acquire() o = self.q[0] del q[0] self.lock.release() return o def __len__(self): self.lock.acquire() ell=len(self.q) self.lock.release() return ell queue=cache.ram('queue',lambda:Queue,Queue.forever) queue.enqueue('object') print len(queue) o =queue.dequeue() If you define it in a model it will be visible everywhere, including cron scripts. I am not sure if the lock is really necessary (because of the global interpreter lock) but it is safe. queue.append( On Jul 9, 4:07 pm, kralin andrea.pierle...@gmail.com wrote: Hi All, I'm diving into web2py that at the
[web2py:26157] Re: javascript function call from controller
Massimo, I can see following: 1. in Jquery documentation: html(val) Set the html contents of every matched element. This property is not available on XML documents (although it will work for XHTML documents). 2. in current svn trunk in web2py_ajax.html something like this: function ajax(u,s,t) { var query=; for(i=0; is.length; i++) { if(i0) query=query+; query=query+encodeURIComponent(s[i])+=+encodeURIComponent(document.getElementById(s[i]).value); } jQuery.ajax({type: POST, url: u, data: query, success: function(msg) { if(t==':eval') eval(msg); else document.getElementById(t).innerHTML=msg; } }); } BUT: I still do not understand, how it should help me to call javascript function from controller. Can you please explain it more? Julius mdipierro wrote / napísal(a): With the latest trunk you can do intput name=value id=value / button onclick=ajax('callback',['value'],':eval')click me/button div id=target/div def callback(): value=request.vars.value return jQuery('#target').html(%s) % repr(str(value)) when you click the button it sends the value of value to the callback function. The function returns a jQuery string and the clients runs it. The trick here is ajax(...,':eval') which is defined by web2py. On Jul 10, 8:56 am, Julius Minka j...@minka.sk wrote: Hi all, I have a javascript function in html file which is usually called from onclick event in the same file. It works fine. However I would like to call this javascript function from a controller. More precise description: after clicking an element in the page, the flow goes to controller. There I decide which dialog to display (I have it working to this point), but it is defined again in html file as jquery dialog opening with .dialog(open); --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26158] Re: drop-box that keeps previous value
On Fri, Jul 10, 2009 at 8:07 AM, mdipierro mdipie...@cs.depaul.edu wrote: We could make keepvalues take a list of file names. ...you mean a list of fields, correct? Anyway, that is what Annet is asking for I think. On Jul 10, 1:16 am, annet annet.verm...@gmail.com wrote: The question to ask here is what would it take to have a drop box keep the previous value as default. It was just a thought. While entering data into a timetable table I found it inconvenient that I had to select the day time and again from the drop box, which defaults to Monday. Same thing when I entered data into a table that contains the opening hours of a creche facility in a fitness and health club. In this case I would like to keep the day (defaults to Monday) and the facility (ordered alphabetically), not the time fields. As I said, just a thought to improve usability to the user. This should be a relatively simple quesition if you are talking about a value last saved - boiling down to now that I've selected / retrieved the last value, how do I programmatically set that as the default in the form? The problem is I lack the proficiency in Python to program something like this myself. Becoming proficient in Python figures highest on my to do list, e.g. I need validators based on key value pairs in query results, not being able to program them myself is rather frustrating Try if form.accepts(...,keepvalues=True) does what you ask. keepvalues=True keeps all the values, whereas I only want to keep specific values. Kind regards, Annet. --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26159] Re: ip of a logged-in-user
On Fri, Jul 10, 2009 at 8:58 AM, Kuba Kucharski kuba.kuchar...@gmail.comwrote: Hi, Yes, I've been there.. it generates a lot of updates :/ what about a cache-db for this (an in-memory model) ? I thought maybe about some generic js solution already used by someone, we have dozens of very wise people here, sometimes they point me in the direction I've never even dreamt of ;) @speedbird I was trying to find this functionality in your great pyforum thing, but couldn't @all in the future, shouldn't this be implemented inside welcome app ? -- Kuba (pozdrowienia z Warszawy) --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26160] Re: drop-box that keeps previous value
...you mean a list of fields, correct? Anyway, that is what Annet is asking for I think. Yes, a list of fields that should keep their previous values when the form reloads. Something like keepvalues=[field2,field4] Annet. --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26161] Re: What about backward compatibility?
The concepts you discuss are... one perspective, one sided (even if important). Backward compatibility is (in the big picture) a double-edged sword. Yes, Massimo is dedicated to backward compatibility, but Python 3 is not. Python not being so wed to backward compatibility has it's benefits (see http://reinout.vanrees.org/weblog/2009/07/01/ep-bruce-eckel.html and http://www.artima.com/weblogs/viewpost.jsp?thread=260578 for example). Certainly, from web2py's end, backward compatibility is a goal. How many people still run Python 1.6 code, without having migrated it forward (can I see a show of hands?) --- That's my point. When Python 3 moves into the forefront, you may need to make small changes, but this is not the kinds of rewrites you are talking about, where your clients don't care. This is practically backward compatible in that nothing devastating or earth shaking takes place. This is probably the same approach to expect here. Backward compatibility is a goal... But you are not encouraged to use T2 (anymore); there are better ways now. Yes, it will still run. And DAL will change, for the better. ... and so on. The point is to keep making sense - consider the client, the developer, AND forward progress, and strike that balance of concerns. (That, after all, is what intentional design is - consider the involved parties, and balancing concerns). - Yarko On Fri, Jul 10, 2009 at 11:08 AM, viniciusban vinicius...@gmail.com wrote: On Jul 10, 12:29 pm, mdipierro mdipie...@cs.depaul.edu wrote: OK. check out web2py.com, the second item after the slides. Nice! And so quick. :-) -- [ ]s Vinicius Assef. --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26162] ssh tunnel from windows (putty) client [ security and admin ]
goal: to be able to publicly view the admin interface from a windows client. ( my web2py server is running on a linux) the instructions in this page are very good. http://mdp.cti.depaul.edu/AlterEgo/default/show/68 However, how can I make an ssh tunnel in windows? ( note: putty is installed) Thanks Jeff --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26163] Re: web2py cache
Is there a way to just cache the object and not the function? --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26165] Re: ssh tunnel from windows (putty) client [ security and admin ]
You should save the information of the connection (session) and from the left side (below categories), Connection-SSH-Tunnels: (look at the right side now) Add new forwarded port: Source Port (8000) or the port you use in web2py Destination (localhost:8000) or the port you use in web2py Click add and go back to session (left side) and save session again. Now you can just open the connection, login, password and access http://localhost:8000/admin from your browser. 2009/7/10 Jeffield jeff.sheffi...@gmail.com goal: to be able to publicly view the admin interface from a windows client. ( my web2py server is running on a linux) the instructions in this page are very good. http://mdp.cti.depaul.edu/AlterEgo/default/show/68 However, how can I make an ssh tunnel in windows? ( note: putty is installed) Thanks Jeff -- Atenciosamente -- = Alexandre Andrade Hipercenter.com --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26166] Re: DAL remote control
Thx for the review of my idea. For what it's worth, Here is a sample of my code which uses 'eval' to create the DAL code: The input args are the db object, a db.tbl object, and a string of comma separated DAL-type field specifiers (eg. db.myTbl.person, db.myTbl.dog...) --- def Select(db, tbl, selectStr): if (selectStr == '') or (selectStr == 'ALL'): rows = db().select(tbl.ALL) else: selectFldStrs = selectStr.split(',') selectFlds = [eval(fldstr) for fldstr in selectFldStrs] rows = db().select(*selectFlds) return rows.response --- On Jul 10, 6:19 am, mdipierro mdipie...@cs.depaul.edu wrote: There is no eval in DAL. Actually b) is safer. The overhead is negligible compared to the database IO times. You are doing the right thing On Jul 10, 1:55 am, rb rbspg...@gmail.com wrote: Thx for the speedy reply. Here's another question: 3) Because I'm doing a thick client, it creates db queries (SQL CRUD) which need to be communicated back to the controller which must query the db. The two ways to do this are: a) use a SQL statement within a executesql command, or b) create a DAL row selection criteria string and a column selection criteria string, send them back to the controller which feeds them through a python eval statement within a DAL function. It is always pointed out that b) is dangerous because it's possible for unintended string matter to get fed into the eval - which can reek havoc. However only *my* strings from the client which I have carefully massaged will ever be sent (e.g. I collect the column names from the db beforehand and provide them to the db().select(fieldnames- here) statement). Further, if I craft a SQL string then it too can suffer from bad input. I just have to be extra careful when creating the query strings. However if I use a) then I lose all of the functionality provided by the DAL. I've never been a fan of SQL and I'd like to avoid it in favour of what the DAL can offer. So I've implemented b) and it is working. My questions are: i) am I missing the obvious? Is there a much simpler/better way to do this? ii) does the DAL add much overhead? On Jul 9, 9:21 pm, mdipierro mdipie...@cs.depaul.edu wrote: On Jul 9, 11:04 pm, rb rbspg...@gmail.com wrote: Hi all, I'm using Web2py to serve a wxPython thick client via XMLRPC. I'm currently using SQLite (I like the zero db config ;-) and I have a few questions: 1) I have missed how to specify table constraints across several fields (in SQLite). For example, in a table the primary key consists of two fields - how do I specify that these two fields must comprise a UNIQUE value? In other dbs I could use executesql to just give the SQL commands, but SQLite (unless I'm mistaken) only allows table constraints within the CREATE TABLE SQL command. So can this be done in Web2py? You cannot create such constraint database side from web2py. Your options are: 1) enforce the constraint at the validators level 2) create the table outside web2py and set migrate=False 2) I'm confused as to which models get run when a controller is accessed. If I have db.py and uom.py models and I access the uom controller, what happens? From stepping thru the debugger I saw db.py get run first, then uom.py and then uom.py again (weird). I've simplified things down to just one (db.py) file for now, but I'm wondering if the infrastructure's intent is to run all model files upon each and every controller access. Oh, my access of the controller is via XMLRPC function (if that changes anything). All of them. Alphabetically. There has been some discussion on whether there should be exceptions to this rule. It would be easy to inplmenet but there was no consensus on whether an improvement was necessary. --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26167] Re: DAL remote control
On Jul 10, 5:48 am, Fran francisb...@googlemail.com wrote: On Jul 10, 9:40 am, rb rbspg...@gmail.com wrote: I don't have the resources for ajax thin client programming. I'll stick with the trials of deploying the thick client. I don't think you need full-blown GWT to have an AJAX client. jQuery (integrated with Web2Py) allows 'progressive enhancement' of plain old HTML to increase interactivity. e.g. look at the miracle of the dataTables plugin which I'm just about to make use of:http://www.datatables.net/ When I started this project, I asked the marketing folk are you *sure* that this is only a desktop app and not something which needs to be webified? They said no no no.. just make it a simple desktop app. But I knew better, I continued to ask and they would answer that a desktop app was what was wanted, oh... and can it also work across the internet too? !...@#$ I had done some mock ups in wxPython and so became familiar with it's screen layout system. One fellow described the screen layout system as having a learning curve like a brick wall grin tis true. But in the end it is still simpler to develop in than css and html webpages, from the little I know now. My main design requirement was having a back door. I couldn't forsee all that was required because a) I didn't know enough, and b) marketing want something different each week. So I chose Python because it has every advantage except speed - but I can later on code time critical stuff in C and plug it in (ie, I have a speed back door). I mostly just needed a fat client and some kind of db and a report generator. But when this can it work across the internet too? noise started getting louder I knew that a web app was the answer. Upon finding web2py I now have a web server complete with simple db (in SQLite) which can serve up webservices for my fat client and I'll use a webpage/html renderer widget in the client to receive the report web2py view pages. Right now the design calls for an ability to dial in via modems from a client to the server in order to fetch batches of data and view reports. So I'm not too concerned about web- based security. The important issue here is that I can use a *simple* system which can get something developed quickly and which allows evolution into greater complexity/sophistication later. From what I understand, web2py will work quite well here. Thank you for the heads-up on considering ajax via jQuery et al. I'll continue to look into this. Perhaps I can combine the two (ajax pages and xmlrpc forms). BTW that datatables.net is amazing. -- Rb But wait, I'll also need to generate lots of reports and you could burn me with fire before I'll slog through using Crystal Reports for this. No, I can use Web2py and python and code up some html reports from the db. The entry forms and inquiry forms of the thick client I'm doing in wxPython will work fine. Even easier if you let Web2Py build these for you via sqlhtml.py :) You can AJAXify the forms using jQuery Form plugin if you like... I can use xmlrpc for the client-to- svr protocol. Who cares if its grossly slow ? (even though I'm led to believe that it's not so slow) if it's all on the same machine. Same machine = no big issue...JSON is only better for WAN performance. However, the customer wants to see his reports from his browser out on the 'net somewhere. How can I deliver such? Oh look, there's web2py. Awesome. In a few short days of reading even *I* can understand how to hack something together - and I'm just starting (in python). I've still got to watch out for the speed of communication issue but that's tomorrow's problem and there won't be a tomorrow if I have to use ajax. Well, I think that maybe you'd be better with Web2Py/jQuery rather than Web2Py/wxPython. However what you propose is also ok... F --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26168] Re: latest sqlhtml.py breaks update function
Yep, Massimo, your last fix broke it (line 737+), esp the if not self.errors: ret = true here ret is set to true where it shouldn't be... On Fri, Jul 10, 2009 at 3:21 PM, annetannet.verm...@gmail.com wrote: Hans, What version where you using before (please spicy svn or bazaar/launchpad) ? I was using the sqlhtml file that came with the source code of web2py version 1.65.0. Can you (perhpas) try what version is still working: see eghttp://bazaar.launchpad.net/~mdipierro/web2py/devel/changes?filter_fi... (bazaar launchpad) I checked all versions of the sqlhtml.py file from 1005 upward, version 1011 is the last one that works, version 1013 breaks the update function, as does version 1014. Can you show some simple code that we can use to reproduce this? I wanted to update a record using the web2py's admin when I discovered that the update function no longer works, my own update functions call the update function: @auth.requires_membership('tier2_manager') def update_openinghour(): response.view='tier1/update.html' db.openingstijd.bedrijf.writable=False record=db.openingstijd[request.args[0]] if not record or not record.bedrijf==auth.user.bedrijf: redirect(URL(r=request,f='crud_openinghour')) form=update_form(db.openingstijd,record,'crud_openinghour') return dict(form=form) def update_form(table,rec,nxt): form=crud.update(table,rec,next=(URL(r=request,f=nxt))) form[0][-1][1].append(INPUT (_type='button',_value='Cancel',_onclick='javascript:history.go (-1)')) return form Kind regards, Annet. --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26169] Re: drop-box that keeps previous value
I think this is generally useful; in fact an inverse of this is common in forms you've seen around the net: For exaample, register to a site and server validation fails: you get your form presented back to you with maybe a few sensitive fields (e.g. password) On Fri, Jul 10, 2009 at 1:11 PM, annet annet.verm...@gmail.com wrote: ...you mean a list of fields, correct? Anyway, that is what Annet is asking for I think. Yes, a list of fields that should keep their previous values when the form reloads. Something like keepvalues=[field2,field4] something like keepvalues=~[password] Annet. --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26170] Re: eStore appliance
I am very much interested in building a new and more powerful eStore. I think we need to setup a task force of people interested int his and build one all together. We need somebody willing coordinate and be project leader. Massimo On Jul 10, 11:45 am, Benigno bca...@albendas.com wrote: Hey, I just happen to have been playing around both with estore and with the Paypal Engine that Matt did. (I have the same problem you do, UK is the only country that gets some of googles love in europe, the rest go way behind, so no google checkout here either). Actually Google checkout works only in US, UK (and Canada maybe, if I recall correctly) Anyways, the Engine that Matt did, does NVP, which allows you to integrate Paypal to a different level than most people probably need (which is much more simmilar to what Massimo has on his EStore app). Right now on the Engine that Matt did, you only have the DoDirectPayment already setup (which is to process the data of a transaction for which you hold all the customers data including credit card etc). If you need to do the whole checkout with Paypal with NVP, its a longer process, if I remember ok, you actually first stablish a connection, then you get a token from paypal validating it, you redirect to a URL with that token, then then you get the validation of all the data from the customer, then you process your cart confirming the sale, and get another response giving you the data you would need to show the customer the receipt... its something like this. However, there is a very simple way to set it up that works almost exactly like what Massimo shows for google. I am just in the process of modifying EStore to put it in place in a very simplified way, but I am sure you can take it up from there to do whatever you want. I'll send it to Massimo if its ok, as I am building a bit over his code, and would rather he posts it if he feels its ok. I'll try to have it by next monday. Cheers, Benigno. On 4 jul, 06:20, suiato homm...@gmail.com wrote: just restarted to work on eStore yesterday, trying to use it as a reference for one of my projects. it's a good and useful example for me to learn translation and system in web2py. Google checkout for merchants is still not available in countries other than US and UK, though its application pages now appear here in Japanese... Found an appliancePayPalEngine by Matt Sellers athttp://mdp.cti.depaul.edu/appliances. Could be integrated into eStore? eStore may be old and need a lot of work to be a full-fledged e- commerce appliance. It'd be nice to have it that way, but there's another interest in removing fluffy parts and trimming down to its skeleton. This way, logics will be revealed more clearly, easy to understand the structure, and easy to extend it as necessary. Dreaming a dream of the skeletal eStore to be applied to various devices like iPhone, mobiles, PDA and others without changing its logical core... -- Teru On 7月4日, 午前1:41, mdipierro mdipie...@cs.depaul.edu wrote: eStoreis now an old app. It needs lots of work. Massimo On Jul 3, 11:36 am, mingodad mingo...@gmail.com wrote: I was caught too by the error messages too small or too large I sugest to add the folowing to the css part on layout.html: .error { background-color: red; color: white; padding: 3px } It was borroed from T3, this way the error messages will not pass unnoticed. As well I'm intrigged why the *_bc fields doesn't get the default values like the others ! --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26171] Re: auth_add_permission()
Make a proposal. Perhaps passing a SQLQuery instead of a record id? On Jul 10, 12:19 pm, Jonathan Lundell jlund...@pobox.com wrote: auth_add_permission() (and its brethren) accept a record_id, or 0 for a whole table. I'm wondering whether it'd be practical to extend that to specify a horizontal slice of a table, perhaps defined by the value of a field, or more generally a select. And even more generally, a set of fields from that set of rows. --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26172] Re: javascript function call from controller
You cannot call the javascript from the controller. The js calls the controller, the controller responds with other js that gets executed by the browser. On Jul 10, 12:34 pm, Julius Minka j...@minka.sk wrote: Massimo, I can see following: 1. in Jquery documentation: html(val) Set the html contents of every matched element. This property is not available on XML documents (although it will work for XHTML documents). 2. in current svn trunk in web2py_ajax.html something like this: function ajax(u,s,t) { var query=; for(i=0; is.length; i++) { if(i0) query=query+; query=query+encodeURIComponent(s[i])+=+encodeURIComponent(document.getElementById(s[i]).value); } jQuery.ajax({type: POST, url: u, data: query, success: function(msg) { if(t==':eval') eval(msg); else document.getElementById(t).innerHTML=msg; } }); } BUT: I still do not understand, how it should help me to call javascript function from controller. Can you please explain it more? Julius mdipierro wrote / napísal(a): With the latest trunk you can do intput name=value id=value / button onclick=ajax('callback',['value'],':eval')click me/button div id=target/div def callback(): value=request.vars.value return jQuery('#target').html(%s) % repr(str(value)) when you click the button it sends the value of value to the callback function. The function returns a jQuery string and the clients runs it. The trick here is ajax(...,':eval') which is defined by web2py. On Jul 10, 8:56 am, Julius Minka j...@minka.sk wrote: Hi all, I have a javascript function in html file which is usually called from onclick event in the same file. It works fine. However I would like to call this javascript function from a controller. More precise description: after clicking an element in the page, the flow goes to controller. There I decide which dialog to display (I have it working to this point), but it is defined again in html file as jquery dialog opening with .dialog(open); --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26173] Re: ip of a logged-in-user
Yes we have that. Look into gluon.contrib.memdb On Jul 10, 1:03 pm, Yarko Tymciurak yark...@gmail.com wrote: On Fri, Jul 10, 2009 at 8:58 AM, Kuba Kucharski kuba.kuchar...@gmail.comwrote: Hi, Yes, I've been there.. it generates a lot of updates :/ what about a cache-db for this (an in-memory model) ? I thought maybe about some generic js solution already used by someone, we have dozens of very wise people here, sometimes they point me in the direction I've never even dreamt of ;) @speedbird I was trying to find this functionality in your great pyforum thing, but couldn't @all in the future, shouldn't this be implemented inside welcome app ? -- Kuba (pozdrowienia z Warszawy) --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26174] Re: What about backward compatibility?
web2py is not moving to Python 3. Period. We may have a web3py in the future while still supporting and improving web2py. That is not a priority right now. On Jul 10, 1:20 pm, Yarko Tymciurak yark...@gmail.com wrote: The concepts you discuss are... one perspective, one sided (even if important). Backward compatibility is (in the big picture) a double-edged sword. Yes, Massimo is dedicated to backward compatibility, but Python 3 is not. Python not being so wed to backward compatibility has it's benefits (seehttp://reinout.vanrees.org/weblog/2009/07/01/ep-bruce-eckel.htmlandhttp://www.artima.com/weblogs/viewpost.jsp?thread=260578for example). Certainly, from web2py's end, backward compatibility is a goal. How many people still run Python 1.6 code, without having migrated it forward (can I see a show of hands?) --- That's my point. When Python 3 moves into the forefront, you may need to make small changes, but this is not the kinds of rewrites you are talking about, where your clients don't care. This is practically backward compatible in that nothing devastating or earth shaking takes place. This is probably the same approach to expect here. Backward compatibility is a goal... But you are not encouraged to use T2 (anymore); there are better ways now. Yes, it will still run. And DAL will change, for the better. ... and so on. The point is to keep making sense - consider the client, the developer, AND forward progress, and strike that balance of concerns. (That, after all, is what intentional design is - consider the involved parties, and balancing concerns). - Yarko On Fri, Jul 10, 2009 at 11:08 AM, viniciusban vinicius...@gmail.com wrote: On Jul 10, 12:29 pm, mdipierro mdipie...@cs.depaul.edu wrote: OK. check out web2py.com, the second item after the slides. Nice! And so quick. :-) -- [ ]s Vinicius Assef. --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26180] Re: drop-box that keeps previous value
This is more difficult than I thought. It requires major change in that delicate mechanism that is form validation. It will happen but not today. Massimo On Jul 10, 2:43 pm, Yarko Tymciurak yark...@gmail.com wrote: I think this is generally useful; in fact an inverse of this is common in forms you've seen around the net: For exaample, register to a site and server validation fails: you get your form presented back to you with maybe a few sensitive fields (e.g. password) On Fri, Jul 10, 2009 at 1:11 PM, annet annet.verm...@gmail.com wrote: ...you mean a list of fields, correct? Anyway, that is what Annet is asking for I think. Yes, a list of fields that should keep their previous values when the form reloads. Something like keepvalues=[field2,field4] something like keepvalues=~[password] Annet. --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26181] Re: Sending a welcome message but not a cofirm message...
def welcome(form): auth.settings.mailer.send(to=form.vars.email,message='Hello %s' %form.vars.first_name) auth.settings.register_onaccept = welcome Massimo On Jul 10, 6:14 pm, Jason Brower encomp...@gmail.com wrote: Hmm I get an error. it tells me that there is no sent method. Traceback (most recent call last): File /home/encompass/Desktop/web2py/gluon/restricted.py, line 176, in restricted exec ccode in environment File /home/encompass/Desktop/web2py/applications/gbata/controllers/default.py, line 202, in module File /home/encompass/Desktop/web2py/gluon/globals.py, line 103, in lambda self._caller = lambda f: f() File /home/encompass/Desktop/web2py/applications/gbata/controllers/default.py, line 159, in user return dict(form = auth()) File /home/encompass/Desktop/web2py/gluon/tools.py, line 466, in __call__ return self.register() File /home/encompass/Desktop/web2py/gluon/tools.py, line 915, in register onaccept(form) File /home/encompass/Desktop/web2py/applications/gbata/controllers/default.py, line 13, in welcome auth.settings.mailer.sent(to=form.vars.email, message='Hello %s' % form.vars.first_name) AttributeError: 'Mail' object has no attribute 'sent' Any ideas? Regards, JAson On Fri, 2009-07-10 at 09:56 -0700, mdipierro wrote: def welcome(form): auth.settings.mailer.sent(to=form.vars.email,message='Hello %s' % form.vars.first_name) auth.settings.register_onaccept = welcome Need to add this to the book. Thanks for the reminder. Massimo On Jul 10, 2:25 pm, Jason Brower encomp...@gmail.com wrote: Is there a way with auth to send a welcome message when people register? Regards, JAson --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26182] Re: sending HTML emails
Yarko, I can tell you are still at web2py 1.52. ;-) Massimo On Jul 10, 3:15 pm, Yarko Tymciurak yark...@gmail.com wrote: See http://bazaar.launchpad.net/~yarkot1/web2conf/pycon2009site/annotate/... (just use send() instead of t2.eamil() ) On Fri, Jul 10, 2009 at 1:31 PM, kralin andrea.pierle...@gmail.com wrote: I spent the whole afternoon trying to send an HTML formatted email with web2py. while I cannote use smtplib directly, cause it seems not to work, and I think this should be normal in the framework. however in the current release (Version 1.65.0 (2009-07-01 12:16:25)) it is not possible to alter the content-type, or any other header for the email using the gluon.tools.Mail class. this happens because anu message that is passed to the mail=Mail() object is attached to this string before beeing sent: msg = '''From: %s\r To: %s\r Subject: %s\r \r %s'''\ and the double newlines close the headers. so it would be very useful to also set at least something link this: def send( self, to, subject='None', message='None', headers='\r\n' ): msg = '''From: %s\r To: %s\r Subject: %s\r \r %s'''\ % (self.settings.sender, ', '.join(to), subject,headers, message) so that it will be possible to pass directly some header strings or pass an empty string as headers, and put them in the message. this way they can be correctly recognized. hope this helps cheers --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26185] task forces
I think we need to build two task forces. 1) to build a CMS 2) to build a eStore the more overlap the better. We need two project leaders and volunteers. I also suggest starting by creating google docs to gather requirements. Lots of people needs these, including me. 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26186] Re: task forces
I like the idea! I'd like to be a tester, documenter for the eStore. Sterling On Fri, Jul 10, 2009 at 3:32 PM, mdipierro mdipie...@cs.depaul.edu wrote: I think we need to build two task forces. 1) to build a CMS 2) to build a eStore the more overlap the better. We need two project leaders and volunteers. I also suggest starting by creating google docs to gather requirements. Lots of people needs these, including me. 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26176] Re: Sending a welcome message but not a cofirm message...
Hmm I get an error. it tells me that there is no sent method. Traceback (most recent call last): File /home/encompass/Desktop/web2py/gluon/restricted.py, line 176, in restricted exec ccode in environment File /home/encompass/Desktop/web2py/applications/gbata/controllers/default.py, line 202, in module File /home/encompass/Desktop/web2py/gluon/globals.py, line 103, in lambda self._caller = lambda f: f() File /home/encompass/Desktop/web2py/applications/gbata/controllers/default.py, line 159, in user return dict(form = auth()) File /home/encompass/Desktop/web2py/gluon/tools.py, line 466, in __call__ return self.register() File /home/encompass/Desktop/web2py/gluon/tools.py, line 915, in register onaccept(form) File /home/encompass/Desktop/web2py/applications/gbata/controllers/default.py, line 13, in welcome auth.settings.mailer.sent(to=form.vars.email, message='Hello %s' % form.vars.first_name) AttributeError: 'Mail' object has no attribute 'sent' Any ideas? Regards, JAson On Fri, 2009-07-10 at 09:56 -0700, mdipierro wrote: def welcome(form): auth.settings.mailer.sent(to=form.vars.email,message='Hello %s' % form.vars.first_name) auth.settings.register_onaccept = welcome Need to add this to the book. Thanks for the reminder. Massimo On Jul 10, 2:25 pm, Jason Brower encomp...@gmail.com wrote: Is there a way with auth to send a welcome message when people register? Regards, JAson --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26179] Re: latest sqlhtml.py breaks update function
You are right. I think I fixed the fix and I am uploading 1017. Please give it a try. On Jul 10, 2:32 pm, Hans Donner hans.don...@pobox.com wrote: Yep, Massimo, your last fix broke it (line 737+), esp the if not self.errors: ret = true here ret is set to true where it shouldn't be... On Fri, Jul 10, 2009 at 3:21 PM, annetannet.verm...@gmail.com wrote: Hans, What version where you using before (please spicy svn or bazaar/launchpad) ? I was using the sqlhtml file that came with the source code of web2py version 1.65.0. Can you (perhpas) try what version is still working: see eghttp://bazaar.launchpad.net/~mdipierro/web2py/devel/changes?filter_fi... (bazaar launchpad) I checked all versions of the sqlhtml.py file from 1005 upward, version 1011 is the last one that works, version 1013 breaks the update function, as does version 1014. Can you show some simple code that we can use to reproduce this? I wanted to update a record using the web2py's admin when I discovered that the update function no longer works, my own update functions call the update function: @auth.requires_membership('tier2_manager') def update_openinghour(): response.view='tier1/update.html' db.openingstijd.bedrijf.writable=False record=db.openingstijd[request.args[0]] if not record or not record.bedrijf==auth.user.bedrijf: redirect(URL(r=request,f='crud_openinghour')) form=update_form(db.openingstijd,record,'crud_openinghour') return dict(form=form) def update_form(table,rec,nxt): form=crud.update(table,rec,next=(URL(r=request,f=nxt))) form[0][-1][1].append(INPUT (_type='button',_value='Cancel',_onclick='javascript:history.go (-1)')) return form Kind regards, Annet. --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26188] Re: sending HTML emails
well, web2conf was... I found your update (actually I think its on launchpad) and it looks like you worked off of something older than what we ran at the conference, so will need to merge and update all the parts from last years conference site. I'll try to do that before you leave so you can have a merged copy on your trip, for what we discussed yesterday. On Fri, Jul 10, 2009 at 3:24 PM, mdipierro mdipie...@cs.depaul.edu wrote: Yarko, I can tell you are still at web2py 1.52. ;-) Massimo On Jul 10, 3:15 pm, Yarko Tymciurak yark...@gmail.com wrote: See http://bazaar.launchpad.net/~yarkot1/web2conf/pycon2009site/annotate/.http://bazaar.launchpad.net/%7Eyarkot1/web2conf/pycon2009site/annotate/. .. (just use send() instead of t2.eamil() ) On Fri, Jul 10, 2009 at 1:31 PM, kralin andrea.pierle...@gmail.com wrote: I spent the whole afternoon trying to send an HTML formatted email with web2py. while I cannote use smtplib directly, cause it seems not to work, and I think this should be normal in the framework. however in the current release (Version 1.65.0 (2009-07-01 12:16:25)) it is not possible to alter the content-type, or any other header for the email using the gluon.tools.Mail class. this happens because anu message that is passed to the mail=Mail() object is attached to this string before beeing sent: msg = '''From: %s\r To: %s\r Subject: %s\r \r %s'''\ and the double newlines close the headers. so it would be very useful to also set at least something link this: def send( self, to, subject='None', message='None', headers='\r\n' ): msg = '''From: %s\r To: %s\r Subject: %s\r \r %s'''\ % (self.settings.sender, ', '.join(to), subject,headers, message) so that it will be possible to pass directly some header strings or pass an empty string as headers, and put them in the message. this way they can be correctly recognized. hope this helps cheers --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26175] Re: web2py cache
You always cache the object returned by the function. The function can be a dummy that returns the object you want to cache. On Jul 10, 1:30 pm, krista klarso...@msn.com wrote: Is there a way to just cache the object and not the function? --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26177] Re: sending HTML emails
While this can be and something like this can be added it is my understanding that you do not need to change the header to send html emails. You need to use the MIME encoding and that should be transparent to what mail.send does now. If I am wrong please provide an example of how to change the headers to send a MIME encoded message. On Jul 10, 1:31 pm, kralin andrea.pierle...@gmail.com wrote: I spent the whole afternoon trying to send an HTML formatted email with web2py. while I cannote use smtplib directly, cause it seems not to work, and I think this should be normal in the framework. however in the current release (Version 1.65.0 (2009-07-01 12:16:25)) it is not possible to alter the content-type, or any other header for the email using the gluon.tools.Mail class. this happens because anu message that is passed to the mail=Mail() object is attached to this string before beeing sent: msg = '''From: %s\r To: %s\r Subject: %s\r \r %s'''\ and the double newlines close the headers. so it would be very useful to also set at least something link this: def send( self, to, subject='None', message='None', headers='\r\n' ): msg = '''From: %s\r To: %s\r Subject: %s\r \r %s'''\ % (self.settings.sender, ', '.join(to), subject,headers, message) so that it will be possible to pass directly some header strings or pass an empty string as headers, and put them in the message. this way they can be correctly recognized. hope this helps cheers --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26178] Re: sending HTML emails
See http://bazaar.launchpad.net/~yarkot1/web2conf/pycon2009site/annotate/head%3A/applications/register/models/db_fa.py (just use send() instead of t2.eamil() ) On Fri, Jul 10, 2009 at 1:31 PM, kralin andrea.pierle...@gmail.com wrote: I spent the whole afternoon trying to send an HTML formatted email with web2py. while I cannote use smtplib directly, cause it seems not to work, and I think this should be normal in the framework. however in the current release (Version 1.65.0 (2009-07-01 12:16:25)) it is not possible to alter the content-type, or any other header for the email using the gluon.tools.Mail class. this happens because anu message that is passed to the mail=Mail() object is attached to this string before beeing sent: msg = '''From: %s\r To: %s\r Subject: %s\r \r %s'''\ and the double newlines close the headers. so it would be very useful to also set at least something link this: def send( self, to, subject='None', message='None', headers='\r\n' ): msg = '''From: %s\r To: %s\r Subject: %s\r \r %s'''\ % (self.settings.sender, ', '.join(to), subject,headers, message) so that it will be possible to pass directly some header strings or pass an empty string as headers, and put them in the message. this way they can be correctly recognized. hope this helps cheers --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:/] Multithreaded and Multicore Programming/Solutions
Guys I am not expert just thinking about the Twiiter/Rails problem and Scala solution and I was wondering that with Python. I heard the best option to use Web2py is 2.5 and this version doesn't support same features that take care kind of the Multithreaded and Multicore problems on Python 2.6 and 3.0. One of the solutions is parallel program which can run on multiple cores in Python, does Django does has a better approach to that, because several apps? What about those approaches, can someone explain them better,newbie way: 1-Write a multithreaded program using the threading module and run it in the IronPython or Jython runtime. 2-Use the processing module, (now included in Python 2.6), to run your code in multiple processes at once. 3-Use the subprocess module to run multiple python interpreters and communicate between them. 4-Use Twisted and Ampoule. This has the advantage of not just running your code across different processes, but (if you don't share access to things like files) potentially across different computers as well. I was wondering how are the options to take care of those problems what are the future? Looks like Python has way better options that Ruby for now. Thanks. --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26191] Re: task forces
I've always been on the opinion that MVC like WEB2PY (i.e. a normal MVC) is a MVC and a CMS in one (probably I am missing some end-users' points of view). But eStore - that makes a lot of sense to me, so I am for it. On Jul 10, 11:49 pm, Yarko Tymciurak yark...@gmail.com wrote: Those are bigger, more ambitious projects. We could start with something shorter, just to work out the task force processes Perhaps a web2py resources site, an update to the appliances app could be the first part of that (and an update to it). This will give us relatively little to do, and we can work out what will work: I would like to see regular meetings (IRC), and _real_ distance, on-line code sprints... so that a 2 hour session will find everyone coding a piece, and a leader merging and running it live for all to review, update, etc. (leader to push up to a launchpad, or mercurial). One of the process things to work out: stay launchpad, or move code.google.com / mercurial. The latter would give us (if they've worked it out) a code review site, which would be a great way for task force to work asynchronously (e.g. in between code-sprint meetings). Code sprints would be useful - if the balance on a team was 3 / 2 or so of experienced python-web2py-ers, vs people wanting to learn, stretch it would be a great way to regularly have a place to join in --- real community stuff. How does this sound? A simpler job to work out the basics of the working process, find what will work for starters. - Yarko On Fri, Jul 10, 2009 at 3:37 PM, eric cs eeri...@gmail.com wrote: I am in...but no knowledge, just wanna help and learn on the process if that is possible, count with me. On Jul 10, 4:32 pm, mdipierro mdipie...@cs.depaul.edu wrote: I think we need to build two task forces. 1) to build a CMS 2) to build a eStore the more overlap the better. We need two project leaders and volunteers. I also suggest starting by creating google docs to gather requirements. Lots of people needs these, including me. 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26192] Re: task forces
We have to beat them...hehehe Rails for Spree and Magento for Php/Zend. At least Magento for inspiration. On Jul 10, 4:49 pm, Yarko Tymciurak yark...@gmail.com wrote: Those are bigger, more ambitious projects. We could start with something shorter, just to work out the task force processes Perhaps a web2py resources site, an update to the appliances app could be the first part of that (and an update to it). This will give us relatively little to do, and we can work out what will work: I would like to see regular meetings (IRC), and _real_ distance, on-line code sprints... so that a 2 hour session will find everyone coding a piece, and a leader merging and running it live for all to review, update, etc. (leader to push up to a launchpad, or mercurial). One of the process things to work out: stay launchpad, or move code.google.com / mercurial. The latter would give us (if they've worked it out) a code review site, which would be a great way for task force to work asynchronously (e.g. in between code-sprint meetings). Code sprints would be useful - if the balance on a team was 3 / 2 or so of experienced python-web2py-ers, vs people wanting to learn, stretch it would be a great way to regularly have a place to join in --- real community stuff. How does this sound? A simpler job to work out the basics of the working process, find what will work for starters. - Yarko On Fri, Jul 10, 2009 at 3:37 PM, eric cs eeri...@gmail.com wrote: I am in...but no knowledge, just wanna help and learn on the process if that is possible, count with me. On Jul 10, 4:32 pm, mdipierro mdipie...@cs.depaul.edu wrote: I think we need to build two task forces. 1) to build a CMS 2) to build a eStore the more overlap the better. We need two project leaders and volunteers. I also suggest starting by creating google docs to gather requirements. Lots of people needs these, including me. Massimo- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26193] Re: Multithreaded and Multicore Programming/Solutions
There is no real problem with python and multi threading (web2py includes a multithreaded server) except for one issue with the Glbal Interpreter Lock (i.e. Python multi threaded apps get slower, not faster the most cores you have unless you lock python on a core, for example by using a virtual machine). This is not a practical concern with typical web hosting service where you get assigned one VM. It is still faster than rails as long as I can tell. The issues you raise are relavent for high performance computing not for web development. web2py runs with Jython out of the box and it does not have the GIL problem but Jython is very slow. Perhaps things will change in the future. I know Jruby is faster than CRuby. Massimo On Jul 10, 3:54 pm, eric cs eeri...@gmail.com wrote: Guys I am not expert just thinking about the Twiiter/Rails problem and Scala solution and I was wondering that with Python. I heard the best option to use Web2py is 2.5 and this version doesn't support same features that take care kind of the Multithreaded and Multicore problems on Python 2.6 and 3.0. One of the solutions is parallel program which can run on multiple cores in Python, does Django does has a better approach to that, because several apps? What about those approaches, can someone explain them better,newbie way: 1-Write a multithreaded program using the threading module and run it in the IronPython or Jython runtime. 2-Use the processing module, (now included in Python 2.6), to run your code in multiple processes at once. 3-Use the subprocess module to run multiple python interpreters and communicate between them. 4-Use Twisted and Ampoule. This has the advantage of not just running your code across different processes, but (if you don't share access to things like files) potentially across different computers as well. I was wondering how are the options to take care of those problems what are the future? Looks like Python has way better options that Ruby for now. Thanks. --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26194] Check out your web2py app in multiple environments
I just got done installing 5 new browsers in my new windows environmenet all running under Linux. If you've got a OS/X, Linux, Solaris, Windows, BSD host and would like to run / test under other environments (like setup a linux that your hosting company has to work out your deployment, before going to them and asking for permissions to files, etc.) or if you just want to test your app (compiled or otherwise) under other environments, then this: http://2linuces.blogspot.com might be interesting to you. - Yarko --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26195] Re: task forces
I wonder if we could use satchmo django project for the estore? On Jul 10, 1:32 pm, mdipierro mdipie...@cs.depaul.edu wrote: I think we need to build two task forces. 1) to build a CMS 2) to build a eStore the more overlap the better. We need two project leaders and volunteers. I also suggest starting by creating google docs to gather requirements. Lots of people needs these, including me. 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26196] Re: task forces
I think for a CMS, defining what to do, how it would look initially, and it's structure could take some time to review the best (or most used) CMS's and what they offer. The basic structure should not be too hard to start (Massimo has started several times). A wiki is probably a core component of this, so considering the components of a CMS might spawn several projects. I'd just want to be sure to start with something that will work, will show how to work in sprint teams, and will produce results rather quickly. Then more ambitious projects will have a way to gain traction. On Fri, Jul 10, 2009 at 3:56 PM, eric cs eeri...@gmail.com wrote: We have to beat them...hehehe Rails for Spree and Magento for Php/Zend. At least Magento for inspiration. On Jul 10, 4:49 pm, Yarko Tymciurak yark...@gmail.com wrote: Those are bigger, more ambitious projects. We could start with something shorter, just to work out the task force processes Perhaps a web2py resources site, an update to the appliances app could be the first part of that (and an update to it). This will give us relatively little to do, and we can work out what will work: I would like to see regular meetings (IRC), and _real_ distance, on-line code sprints... so that a 2 hour session will find everyone coding a piece, and a leader merging and running it live for all to review, update, etc. (leader to push up to a launchpad, or mercurial). One of the process things to work out: stay launchpad, or move code.google.com / mercurial. The latter would give us (if they've worked it out) a code review site, which would be a great way for task force to work asynchronously (e.g. in between code-sprint meetings). Code sprints would be useful - if the balance on a team was 3 / 2 or so of experienced python-web2py-ers, vs people wanting to learn, stretch it would be a great way to regularly have a place to join in --- real community stuff. How does this sound? A simpler job to work out the basics of the working process, find what will work for starters. - Yarko On Fri, Jul 10, 2009 at 3:37 PM, eric cs eeri...@gmail.com wrote: I am in...but no knowledge, just wanna help and learn on the process if that is possible, count with me. On Jul 10, 4:32 pm, mdipierro mdipie...@cs.depaul.edu wrote: I think we need to build two task forces. 1) to build a CMS 2) to build a eStore the more overlap the better. We need two project leaders and volunteers. I also suggest starting by creating google docs to gather requirements. Lots of people needs these, including me. Massimo- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26198] Re: task forces
magneto is nice. On Jul 10, 3:56 pm, eric cs eeri...@gmail.com wrote: We have to beat them...hehehe Rails for Spree and Magento for Php/Zend. At least Magento for inspiration. On Jul 10, 4:49 pm, Yarko Tymciurak yark...@gmail.com wrote: Those are bigger, more ambitious projects. We could start with something shorter, just to work out the task force processes Perhaps a web2py resources site, an update to the appliances app could be the first part of that (and an update to it). This will give us relatively little to do, and we can work out what will work: I would like to see regular meetings (IRC), and _real_ distance, on-line code sprints... so that a 2 hour session will find everyone coding a piece, and a leader merging and running it live for all to review, update, etc. (leader to push up to a launchpad, or mercurial). One of the process things to work out: stay launchpad, or move code.google.com / mercurial. The latter would give us (if they've worked it out) a code review site, which would be a great way for task force to work asynchronously (e.g. in between code-sprint meetings). Code sprints would be useful - if the balance on a team was 3 / 2 or so of experienced python-web2py-ers, vs people wanting to learn, stretch it would be a great way to regularly have a place to join in --- real community stuff. How does this sound? A simpler job to work out the basics of the working process, find what will work for starters. - Yarko On Fri, Jul 10, 2009 at 3:37 PM, eric cs eeri...@gmail.com wrote: I am in...but no knowledge, just wanna help and learn on the process if that is possible, count with me. On Jul 10, 4:32 pm, mdipierro mdipie...@cs.depaul.edu wrote: I think we need to build two task forces. 1) to build a CMS 2) to build a eStore the more overlap the better. We need two project leaders and volunteers. I also suggest starting by creating google docs to gather requirements. Lots of people needs these, including me. Massimo- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26199] Recursive vs Iterative Algorithm
They compare Ruby 1.9 with Python, than a Python guy change the algorithm from being recursive to being iterative and runs way faster...wow. Can you guys explain those ways of programming with simple examples with comments? I heard is very used on functional programming (Erlang,Scala). How to iterative program in Python and Web2py? http://antoniocangiano.com/2007/11/28/holy-shmoly-ruby-19-smokes-python-away/ http://www.mysoftparade.com/blog/ruby-19-doesnt-smoke-python-away/ Thanks. more: http://en.wikipedia.org/wiki/Iteration --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26200] Re: task forces
for me this is a meta-activity: porting as an ending action, starting with analysis of other's solutions. Analyze (reverse engineer) / restructure (for web2py) / adjust design / port is a useful idiom to have down. On Fri, Jul 10, 2009 at 4:09 PM, nathan.ms nathan...@gmail.com wrote: I wonder if we could use satchmo django project for the estore? On Jul 10, 1:32 pm, mdipierro mdipie...@cs.depaul.edu wrote: I think we need to build two task forces. 1) to build a CMS 2) to build a eStore the more overlap the better. We need two project leaders and volunteers. I also suggest starting by creating google docs to gather requirements. Lots of people needs these, including me. 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26201] amf3
the web2py in trunk now works with AMF3. Use the decorator @service.amfrpc3('yournamespace') def yourfunction(): def call(): return service() call it with http://.../app/default/call/amfrpc3 Let me know if it works or does not work for you. I have not tried it yet. --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26202] Re: task forces
On Fri, Jul 10, 2009 at 4:14 PM, mdipierro mdipie...@cs.depaul.edu wrote: I think it would be a good exercise to start from there. I do know if sachmo has this but we it would be nice to a web service layer so that users can develop frontends in html (the default) or Flex (via standard APIs provided by the system). ...not clear what you meant - start from a wiki? start from a CMS basic structure? On Jul 10, 4:11 pm, Yarko Tymciurak yark...@gmail.com wrote: I think for a CMS, defining what to do, how it would look initially, and it's structure could take some time to review the best (or most used) CMS's and what they offer. The basic structure should not be too hard to start (Massimo has started several times). A wiki is probably a core component of this, so considering the components of a CMS might spawn several projects. I'd just want to be sure to start with something that will work, will show how to work in sprint teams, and will produce results rather quickly. Then more ambitious projects will have a way to gain traction. On Fri, Jul 10, 2009 at 3:56 PM, eric cs eeri...@gmail.com wrote: We have to beat them...hehehe Rails for Spree and Magento for Php/Zend. At least Magento for inspiration. On Jul 10, 4:49 pm, Yarko Tymciurak yark...@gmail.com wrote: Those are bigger, more ambitious projects. We could start with something shorter, just to work out the task force processes Perhaps a web2py resources site, an update to the appliances app could be the first part of that (and an update to it). This will give us relatively little to do, and we can work out what will work: I would like to see regular meetings (IRC), and _real_ distance, on-line code sprints... so that a 2 hour session will find everyone coding a piece, and a leader merging and running it live for all to review, update, etc. (leader to push up to a launchpad, or mercurial). One of the process things to work out: stay launchpad, or move code.google.com / mercurial. The latter would give us (if they've worked it out) a code review site, which would be a great way for task force to work asynchronously (e.g. in between code-sprint meetings). Code sprints would be useful - if the balance on a team was 3 / 2 or so of experienced python-web2py-ers, vs people wanting to learn, stretch it would be a great way to regularly have a place to join in --- real community stuff. How does this sound? A simpler job to work out the basics of the working process, find what will work for starters. - Yarko On Fri, Jul 10, 2009 at 3:37 PM, eric cs eeri...@gmail.com wrote: I am in...but no knowledge, just wanna help and learn on the process if that is possible, count with me. On Jul 10, 4:32 pm, mdipierro mdipie...@cs.depaul.edu wrote: I think we need to build two task forces. 1) to build a CMS 2) to build a eStore the more overlap the better. We need two project leaders and volunteers. I also suggest starting by creating google docs to gather requirements. Lots of people needs these, including me. Massimo- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26203] Re: task forces
Flex and Flash front end kick ass. On Jul 10, 5:14 pm, mdipierro mdipie...@cs.depaul.edu wrote: magneto is nice. On Jul 10, 3:56 pm, eric cs eeri...@gmail.com wrote: W We have to beat them...hehehe Rails for Spree and Magento for Php/Zend. At least Magento for inspiration. On Jul 10, 4:49 pm, Yarko Tymciurak yark...@gmail.com wrote: Those are bigger, more ambitious projects. We could start with something shorter, just to work out the task force processes Perhaps a web2py resources site, an update to the appliances app could be the first part of that (and an update to it). This will give us relatively little to do, and we can work out what will work: I would like to see regular meetings (IRC), and _real_ distance, on-line code sprints... so that a 2 hour session will find everyone coding a piece, and a leader merging and running it live for all to review, update, etc. (leader to push up to a launchpad, or mercurial). One of the process things to work out: stay launchpad, or move code.google.com / mercurial. The latter would give us (if they've worked it out) a code review site, which would be a great way for task force to work asynchronously (e.g. in between code-sprint meetings). Code sprints would be useful - if the balance on a team was 3 / 2 or so of experienced python-web2py-ers, vs people wanting to learn, stretch it would be a great way to regularly have a place to join in --- real community stuff. How does this sound? A simpler job to work out the basics of the working process, find what will work for starters. - Yarko On Fri, Jul 10, 2009 at 3:37 PM, eric cs eeri...@gmail.com wrote: I am in...but no knowledge, just wanna help and learn on the process if that is possible, count with me. On Jul 10, 4:32 pm, mdipierro mdipie...@cs.depaul.edu wrote: I think we need to build two task forces. 1) to build a CMS 2) to build a eStore the more overlap the better. We need two project leaders and volunteers. I also suggest starting by creating google docs to gather requirements. Lots of people needs these, including me. Massimo- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26204] Re: task forces
I meant the store is a special class of a CMS so there should be some overlap. On Jul 10, 4:22 pm, Yarko Tymciurak yark...@gmail.com wrote: On Fri, Jul 10, 2009 at 4:14 PM, mdipierro mdipie...@cs.depaul.edu wrote: I think it would be a good exercise to start from there. I do know if sachmo has this but we it would be nice to a web service layer so that users can develop frontends in html (the default) or Flex (via standard APIs provided by the system). ...not clear what you meant - start from a wiki? start from a CMS basic structure? On Jul 10, 4:11 pm, Yarko Tymciurak yark...@gmail.com wrote: I think for a CMS, defining what to do, how it would look initially, and it's structure could take some time to review the best (or most used) CMS's and what they offer. The basic structure should not be too hard to start (Massimo has started several times). A wiki is probably a core component of this, so considering the components of a CMS might spawn several projects. I'd just want to be sure to start with something that will work, will show how to work in sprint teams, and will produce results rather quickly. Then more ambitious projects will have a way to gain traction. On Fri, Jul 10, 2009 at 3:56 PM, eric cs eeri...@gmail.com wrote: We have to beat them...hehehe Rails for Spree and Magento for Php/Zend. At least Magento for inspiration. On Jul 10, 4:49 pm, Yarko Tymciurak yark...@gmail.com wrote: Those are bigger, more ambitious projects. We could start with something shorter, just to work out the task force processes Perhaps a web2py resources site, an update to the appliances app could be the first part of that (and an update to it). This will give us relatively little to do, and we can work out what will work: I would like to see regular meetings (IRC), and _real_ distance, on-line code sprints... so that a 2 hour session will find everyone coding a piece, and a leader merging and running it live for all to review, update, etc. (leader to push up to a launchpad, or mercurial). One of the process things to work out: stay launchpad, or move code.google.com / mercurial. The latter would give us (if they've worked it out) a code review site, which would be a great way for task force to work asynchronously (e.g. in between code-sprint meetings). Code sprints would be useful - if the balance on a team was 3 / 2 or so of experienced python-web2py-ers, vs people wanting to learn, stretch it would be a great way to regularly have a place to join in --- real community stuff. How does this sound? A simpler job to work out the basics of the working process, find what will work for starters. - Yarko On Fri, Jul 10, 2009 at 3:37 PM, eric cs eeri...@gmail.com wrote: I am in...but no knowledge, just wanna help and learn on the process if that is possible, count with me. On Jul 10, 4:32 pm, mdipierro mdipie...@cs.depaul.edu wrote: I think we need to build two task forces. 1) to build a CMS 2) to build a eStore the more overlap the better. We need two project leaders and volunteers. I also suggest starting by creating google docs to gather requirements. Lots of people needs these, including me. Massimo- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26205] Re: Recursive vs Iterative Algorithm
ugh! don't go down the rabbit hole! On Fri, Jul 10, 2009 at 4:19 PM, eric cs eeri...@gmail.com wrote: They compare Ruby 1.9 with Python, than a Python guy change the algorithm from being recursive to being iterative and runs way faster...wow. Can you guys explain those ways of programming with simple examples with comments? I heard is very used on functional programming (Erlang,Scala). How to iterative program in Python and Web2py? http://antoniocangiano.com/2007/11/28/holy-shmoly-ruby-19-smokes-python-away/ http://www.mysoftparade.com/blog/ruby-19-doesnt-smoke-python-away/ Thanks. more: http://en.wikipedia.org/wiki/Iteration --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26206] Re: task forces
I've just _just_ started running the flex for Linux to see if I can make it thru Eckel's First Steps in Flex book, if the Linux alpha is up to the task... On Fri, Jul 10, 2009 at 4:22 PM, eric cs eeri...@gmail.com wrote: Flex and Flash front end kick ass. On Jul 10, 5:14 pm, mdipierro mdipie...@cs.depaul.edu wrote: magneto is nice. On Jul 10, 3:56 pm, eric cs eeri...@gmail.com wrote: W We have to beat them...hehehe Rails for Spree and Magento for Php/Zend. At least Magento for inspiration. On Jul 10, 4:49 pm, Yarko Tymciurak yark...@gmail.com wrote: Those are bigger, more ambitious projects. We could start with something shorter, just to work out the task force processes Perhaps a web2py resources site, an update to the appliances app could be the first part of that (and an update to it). This will give us relatively little to do, and we can work out what will work: I would like to see regular meetings (IRC), and _real_ distance, on-line code sprints... so that a 2 hour session will find everyone coding a piece, and a leader merging and running it live for all to review, update, etc. (leader to push up to a launchpad, or mercurial). One of the process things to work out: stay launchpad, or move code.google.com / mercurial. The latter would give us (if they've worked it out) a code review site, which would be a great way for task force to work asynchronously (e.g. in between code-sprint meetings). Code sprints would be useful - if the balance on a team was 3 / 2 or so of experienced python-web2py-ers, vs people wanting to learn, stretch it would be a great way to regularly have a place to join in --- real community stuff. How does this sound? A simpler job to work out the basics of the working process, find what will work for starters. - Yarko On Fri, Jul 10, 2009 at 3:37 PM, eric cs eeri...@gmail.com wrote: I am in...but no knowledge, just wanna help and learn on the process if that is possible, count with me. On Jul 10, 4:32 pm, mdipierro mdipie...@cs.depaul.edu wrote: I think we need to build two task forces. 1) to build a CMS 2) to build a eStore the more overlap the better. We need two project leaders and volunteers. I also suggest starting by creating google docs to gather requirements. Lots of people needs these, including me. Massimo- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26207] Re: sending HTML emails
I've also tried to use MIME to encode both the html, and an alternative text/html message, however all the encoding goes after the double newline and is not interpreted as an header. so Yarko are you saying that by doing send(message='hello message') instead of send(to=['m...@me.com'], message='hello message') it should worrk by including the correct headers in the message? On 10 Lug, 22:15, mdipierro mdipie...@cs.depaul.edu wrote: While this can be and something like this can be added it is my understanding that you do not need to change the header to send html emails. You need to use the MIME encoding and that should be transparent to what mail.send does now. If I am wrong please provide an example of how to change the headers to send a MIME encoded message. On Jul 10, 1:31 pm, kralin andrea.pierle...@gmail.com wrote: I spent the whole afternoon trying to send an HTML formatted email with web2py. while I cannote use smtplib directly, cause it seems not to work, and I think this should be normal in the framework. however in the current release (Version 1.65.0 (2009-07-01 12:16:25)) it is not possible to alter the content-type, or any other header for the email using the gluon.tools.Mail class. this happens because anu message that is passed to the mail=Mail() object is attached to this string before beeing sent: msg = '''From: %s\r To: %s\r Subject: %s\r \r %s'''\ and the double newlines close the headers. so it would be very useful to also set at least something link this: def send( self, to, subject='None', message='None', headers='\r\n' ): msg = '''From: %s\r To: %s\r Subject: %s\r \r %s'''\ % (self.settings.sender, ', '.join(to), subject,headers, message) so that it will be possible to pass directly some header strings or pass an empty string as headers, and put them in the message. this way they can be correctly recognized. hope this helps cheers --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26208] Re: Check out your web2py app in multiple environments
ugh - can't even spell my own blog address right: http://2linices.blogspot.com/ On Jul 10, 4:05 pm, Yarko Tymciurak yark...@gmail.com wrote: I just got done installing 5 new browsers in my new windows environmenet all running under Linux. If you've got a OS/X, Linux, Solaris, Windows, BSD host and would like to run / test under other environments (like setup a linux that your hosting company has to work out your deployment, before going to them and asking for permissions to files, etc.) or if you just want to test your app (compiled or otherwise) under other environments, then this: http://2linuces.blogspot.com might be interesting to you. - Yarko --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26209] Re: Recursive vs Iterative Algorithm
Yarko, I hope you are not talking about Python vs Ruby, I don't wanna know that just the Recursive vs Iterative Algorithm tecnics to speed you code up!! On Jul 10, 5:27 pm, Yarko Tymciurak yark...@gmail.com wrote: ugh! don't go down the rabbit hole! On Fri, Jul 10, 2009 at 4:19 PM, eric cs eeri...@gmail.com wrote: They compare Ruby 1.9 with Python, than a Python guy change the algorithm from being recursive to being iterative and runs way faster...wow. Can you guys explain those ways of programming with simple examples with comments? I heard is very used on functional programming (Erlang,Scala). How to iterative program in Python and Web2py? http://antoniocangiano.com/2007/11/28/holy-shmoly-ruby-19-smokes-pyth... http://www.mysoftparade.com/blog/ruby-19-doesnt-smoke-python-away/ Thanks. more: http://en.wikipedia.org/wiki/Iteration- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26210] Re: sending HTML emails
Here is the problem. The current implementation of Mail is designed to be cross platform, i.e. work on GAE. It has the same API as GAE. Unless we figure out how to send MIME email messages on GAE, if you want to send MIME you should not use Mail native SMTP. On Jul 10, 4:31 pm, kralin andrea.pierle...@gmail.com wrote: I've also tried to use MIME to encode both the html, and an alternative text/html message, however all the encoding goes after the double newline and is not interpreted as an header. so Yarko are you saying that by doing send(message='hello message') instead of send(to=['@me.com'], message='hello message') it should worrk by including the correct headers in the message? On 10 Lug, 22:15, mdipierro mdipie...@cs.depaul.edu wrote: While this can be and something like this can be added it is my understanding that you do not need to change the header to send html emails. You need to use the MIME encoding and that should be transparent to what mail.send does now. If I am wrong please provide an example of how to change the headers to send a MIME encoded message. On Jul 10, 1:31 pm, kralin andrea.pierle...@gmail.com wrote: I spent the whole afternoon trying to send an HTML formatted email with web2py. while I cannote use smtplib directly, cause it seems not to work, and I think this should be normal in the framework. however in the current release (Version 1.65.0 (2009-07-01 12:16:25)) it is not possible to alter the content-type, or any other header for the email using the gluon.tools.Mail class. this happens because anu message that is passed to the mail=Mail() object is attached to this string before beeing sent: msg = '''From: %s\r To: %s\r Subject: %s\r \r %s'''\ and the double newlines close the headers. so it would be very useful to also set at least something link this: def send( self, to, subject='None', message='None', headers='\r\n' ): msg = '''From: %s\r To: %s\r Subject: %s\r \r %s'''\ % (self.settings.sender, ', '.join(to), subject,headers, message) so that it will be possible to pass directly some header strings or pass an empty string as headers, and put them in the message. this way they can be correctly recognized. hope this helps cheers --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26211] Re: Multithreaded and Multicore Programming/Solutions
Does anyone know why(technical reason), they say Php scale better and it is faster. What does it use to scale better for web apps. On Jul 10, 5:04 pm, mdipierro mdipie...@cs.depaul.edu wrote: There is no real problem with python and multi threading (web2py includes a multithreaded server) except for one issue with the Glbal Interpreter Lock (i.e. Python multi threaded apps get slower, not faster the most cores you have unless you lock python on a core, for example by using a virtual machine). This is not a practical concern with typical web hosting service where you get assigned one VM. It is still faster than rails as long as I can tell. The issues you raise are relavent for high performance computing not for web development. web2py runs with Jython out of the box and it does not have the GIL problem but Jython is very slow. Perhaps things will change in the future. I know Jruby is faster than CRuby. Massimo On Jul 10, 3:54 pm, eric cs eeri...@gmail.com wrote: Guys I am not expert just thinking about the Twiiter/Rails problem and Scala solution and I was wondering that with Python. I heard the best option to use Web2py is 2.5 and this version doesn't support same features that take care kind of the Multithreaded and Multicore problems on Python 2.6 and 3.0. One of the solutions is parallel program which can run on multiple cores in Python, does Django does has a better approach to that, because several apps? What about those approaches, can someone explain them better,newbie way: 1-Write a multithreaded program using the threading module and run it in the IronPython or Jython runtime. 2-Use the processing module, (now included in Python 2.6), to run your code in multiple processes at once. 3-Use the subprocess module to run multiple python interpreters and communicate between them. 4-Use Twisted and Ampoule. This has the advantage of not just running your code across different processes, but (if you don't share access to things like files) potentially across different computers as well. I was wondering how are the options to take care of those problems what are the future? Looks like Python has way better options that Ruby for now. Thanks.- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26212] Re: sending HTML emails
ok, so smtplib should work instead of Mail? On 10 Lug, 23:39, mdipierro mdipie...@cs.depaul.edu wrote: Here is the problem. The current implementation of Mail is designed to be cross platform, i.e. work on GAE. It has the same API as GAE. Unless we figure out how to send MIME email messages on GAE, if you want to send MIME you should not use Mail native SMTP. On Jul 10, 4:31 pm, kralin andrea.pierle...@gmail.com wrote: I've also tried to use MIME to encode both the html, and an alternative text/html message, however all the encoding goes after the double newline and is not interpreted as an header. so Yarko are you saying that by doing send(message='hello message') instead of send(to=['@me.com'], message='hello message') it should worrk by including the correct headers in the message? On 10 Lug, 22:15, mdipierro mdipie...@cs.depaul.edu wrote: While this can be and something like this can be added it is my understanding that you do not need to change the header to send html emails. You need to use the MIME encoding and that should be transparent to what mail.send does now. If I am wrong please provide an example of how to change the headers to send a MIME encoded message. On Jul 10, 1:31 pm, kralin andrea.pierle...@gmail.com wrote: I spent the whole afternoon trying to send an HTML formatted email with web2py. while I cannote use smtplib directly, cause it seems not to work, and I think this should be normal in the framework. however in the current release (Version 1.65.0 (2009-07-01 12:16:25)) it is not possible to alter the content-type, or any other header for the email using the gluon.tools.Mail class. this happens because anu message that is passed to the mail=Mail() object is attached to this string before beeing sent: msg = '''From: %s\r To: %s\r Subject: %s\r \r %s'''\ and the double newlines close the headers. so it would be very useful to also set at least something link this: def send( self, to, subject='None', message='None', headers='\r\n' ): msg = '''From: %s\r To: %s\r Subject: %s\r \r %s'''\ % (self.settings.sender, ', '.join(to), subject,headers, message) so that it will be possible to pass directly some header strings or pass an empty string as headers, and put them in the message. this way they can be correctly recognized. hope this helps cheers --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26213] Re: Recursive vs Iterative Algorithm
On Fri, Jul 10, 2009 at 4:38 PM, eric cs eeri...@gmail.com wrote: Yarko, I hope you are not talking about Python vs Ruby, I don't wanna know that just the Recursive vs Iterative Algorithm tecnics to speed you code up!! :-) No, I meant the rabbit hole of getting caught up in performance numbers! ;-) On Jul 10, 5:27 pm, Yarko Tymciurak yark...@gmail.com wrote: ugh! don't go down the rabbit hole! On Fri, Jul 10, 2009 at 4:19 PM, eric cs eeri...@gmail.com wrote: They compare Ruby 1.9 with Python, than a Python guy change the algorithm from being recursive to being iterative and runs way faster...wow. Can you guys explain those ways of programming with simple examples with comments? I heard is very used on functional programming (Erlang,Scala). How to iterative program in Python and Web2py? http://antoniocangiano.com/2007/11/28/holy-shmoly-ruby-19-smokes-pyth. .. http://www.mysoftparade.com/blog/ruby-19-doesnt-smoke-python-away/ Thanks. more: http://en.wikipedia.org/wiki/Iteration- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26214] Re: Recursive vs Iterative Algorithm
ahaa, yes I on the deep end, but I like to know the diferent way of thinking/programming. and if it makes fast better yet...heheh On Jul 10, 5:49 pm, Yarko Tymciurak yark...@gmail.com wrote: On Fri, Jul 10, 2009 at 4:38 PM, eric cs eeri...@gmail.com wrote: Yarko, I hope you are not talking about Python vs Ruby, I don't wanna know that just the Recursive vs Iterative Algorithm tecnics to speed you code up!! :-) No, I meant the rabbit hole of getting caught up in performance numbers! ;-) On Jul 10, 5:27 pm, Yarko Tymciurak yark...@gmail.com wrote: ugh! don't go down the rabbit hole! On Fri, Jul 10, 2009 at 4:19 PM, eric cs eeri...@gmail.com wrote: They compare Ruby 1.9 with Python, than a Python guy change the algorithm from being recursive to being iterative and runs way faster...wow. Can you guys explain those ways of programming with simple examples with comments? I heard is very used on functional programming (Erlang,Scala). How to iterative program in Python and Web2py? http://antoniocangiano.com/2007/11/28/holy-shmoly-ruby-19-smokes-pyth. .. http://www.mysoftparade.com/blog/ruby-19-doesnt-smoke-python-away/ Thanks. more: http://en.wikipedia.org/wiki/Iteration-Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26215] Re: javascript function call from controller
Julius, Javascript has a built in restrictions at two levels. 1) Do not permit client side file access. 2) Accept only data from the originating DOM source. Both are designed for security protections. Using the ajax call as Massimo defined it permits the state in the current form to change so that the appropriate dialog can be displayed and still conforms to the javascript security model. On Jul 10, 12:34 pm, Julius Minka j...@minka.sk wrote: Massimo, I can see following: 1. in Jquery documentation: html(val) Set the html contents of every matched element. This property is not available on XML documents (although it will work for XHTML documents). 2. in current svn trunk in web2py_ajax.html something like this: function ajax(u,s,t) { var query=; for(i=0; is.length; i++) { if(i0) query=query+; query=query+encodeURIComponent(s[i])+=+encodeURIComponent(document.getElementById(s[i]).value); } jQuery.ajax({type: POST, url: u, data: query, success: function(msg) { if(t==':eval') eval(msg); else document.getElementById(t).innerHTML=msg; } }); } BUT: I still do not understand, how it should help me to call javascript function from controller. Can you please explain it more? Julius mdipierro wrote / napísal(a): With the latest trunk you can do intput name=value id=value / button onclick=ajax('callback',['value'],':eval')click me/button div id=target/div def callback(): value=request.vars.value return jQuery('#target').html(%s) % repr(str(value)) when you click the button it sends the value of value to the callback function. The function returns a jQuery string and the clients runs it. The trick here is ajax(...,':eval') which is defined by web2py. On Jul 10, 8:56 am, Julius Minka j...@minka.sk wrote: Hi all, I have a javascript function in html file which is usually called from onclick event in the same file. It works fine. However I would like to call this javascript function from a controller. More precise description: after clicking an element in the page, the flow goes to controller. There I decide which dialog to display (I have it working to this point), but it is defined again in html file as jquery dialog opening with .dialog(open); --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26216] Re: amf3
What is this for? On Fri, 2009-07-10 at 14:21 -0700, mdipierro wrote: amfrpc3 --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---