Re: [web2py] Re: Off Topic:Pony
Maybe pydal should learn one or 2 tricks from Pony 2018-03-16 4:22 GMT+00:00 Massimo Di Pierro : > yes this it nice. We should take the time to determine which features of > pydal are missing in ponyorm if any. If not maybe web3py should be based on > ponyorm. > > > On Thursday, 8 March 2018 17:47:39 UTC-6, greenpoise wrote: >> >> Nice indeed. Thanks >> >> On Wednesday, March 7, 2018 at 3:19:14 AM UTC-8, Ramos wrote: >>> >>> Nice ... >>> https://ponyorm.com/ >>> >> -- > Resources: > - http://web2py.com > - http://web2py.com/book (Documentation) > - http://github.com/web2py/web2py (Source code) > - https://code.google.com/p/web2py/issues/list (Report Issues) > --- > You received this message because you are subscribed to the Google Groups > "web2py-users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to web2py+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: getting result of SQLFORM.widgets.checkboxes.widget
Great. Thanks for the help. I'll dig around. I guess the weird thing is that checked checkboxes also return None. Anyways, I'll see what i can find and post a follow-up. Thanks again. On Friday, March 23, 2018 at 1:20:57 AM UTC-4, Dave S wrote: > > > > On Thursday, March 22, 2018 at 6:54:16 PM UTC-7, Lee Carmichael wrote: >> >> Hey all, I'm trying to implement two check boxes where the first is >> checked by default, but both or only the second are acceptable checked >> patterns (at least one must be checked). >> >> In my controller I have the following: >> >> MY_OPTIONS = ['In-service view','Future view' ] >> >> form = SQLFORM.factory(Field('search',requires=IS_NOT_EMPTY()), >> Field('view', "list:string", >> default=MY_OPTIONS[0], >> >> widget=SQLFORM.widgets.checkboxes.widget, >> >> requires=[IS_IN_SET(MY_OPTIONS, multiple=True),IS_NOT_EMPTY()])).process() >> >> If I do a print request.vars.search I see the value entered in my search >> field, as expected. However, when I do a print request.vars.view, I get a >> "None". I'm totally lost with the widgets. Any insight would be greatly >> appreciated. >> >> LSC >> > > If I recall a discussion from a couple years ago, an un-checked checkbox > will not be in the vars. > > You might want to try searching the list for 'checkbox' ; I think topics > from March and January of last year may be relevant. > > /dps > > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: getting result of SQLFORM.widgets.checkboxes.widget
I see what was going on. I was only adding the search result to my request.vars so the checkbox results were, as one would expect, not making into request.vars! -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] ECMAScript Modules Vue and Web2py - simple test
Just in case anyone is interested I have uploaded a simple test app with VueJS as modules in the browser. Did it to test and see how it works, as a demo someone could find it useful, more info in the readme file. https://github.com/marcomansilla/yava Opinions are always welcome and appreciated. -- -BEGIN GEEK CODE BLOCK- version 3.1 GCS/GTW/| d? s+:+>+++ a-- C+++(+) UL>$ P++>+++ L+++>+$ E->+ W++>+ N>+++ o K- w---() O(--) M>-- V-- PS++ PE++>+ Y-->+ PGP+>+++ t-(?) 5? X++ R+ !tv b+++> DI+++ D--- G+++>+ e+++> h* r++>+++ y++ --END GEEK CODE BLOCK-- -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Installing web2py in IIS 8.5 wwwroot subfolder
I have been successful installing web2py inside "\Inetpub\wwwroot" as the web2py deployment recipe and other resources instruct. But what I am trying to accomplish is to run it from "\Inetpub\wwwroot\web2py". What I am trying to avoid is too fill wwwroot with python files since there are many ASP .Net sites already installed in that server. I want to be careful and not interfere with the operation of those sites. I suspect I should make changes in the web.config file, but I have not found references to help me with that. My setup: Windows Server 2012R2, IIS 8.5, latest web2py 2.16.1-stable Any pointers will be appreciated. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: ECMAScript Modules Vue and Web2py - simple test
cool, thx for sharing *installation and running step :* *terminal_0* cd path/web2py/applications git clone https://github.com/marcomansilla/yava cd yava/dev npm install ./node_modules/.bin/grunt *terminal_1* python path/web2py/web2py.py --nogui --no-banner -a a -i 0.0.0.0 -p 8000 *terminal_2* open http://localhost:8000/yava *tested work* : signup, logout, login best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [web2py] Re: ECMAScript Modules Vue and Web2py - simple test
You're welcome. Notice the main Vue instance is called only once inside Index.html and components are imported inside the instance and not called un the browser. I hace a few custom init scripts and that's why ommited some steps, but it should work fine as you did. Regards. Marco. El vie., 23 de mar. de 2018 20:51, 黄祥 escribió: > cool, thx for sharing > *installation and running step :* > *terminal_0* > cd path/web2py/applications > git clone https://github.com/marcomansilla/yava > cd yava/dev > npm install > ./node_modules/.bin/grunt > > *terminal_1* > python path/web2py/web2py.py --nogui --no-banner -a a -i 0.0.0.0 -p 8000 > > *terminal_2* > open http://localhost:8000/yava > > *tested work* : signup, logout, login > > best regards, > stifan > > -- > Resources: > - http://web2py.com > - http://web2py.com/book (Documentation) > - http://github.com/web2py/web2py (Source code) > - https://code.google.com/p/web2py/issues/list (Report Issues) > --- > You received this message because you are subscribed to the Google Groups > "web2py-users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to web2py+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [web2py] Re: ECMAScript Modules Vue and Web2py - simple test
yeah, already checked that too, just a suggestion, perhaps better to leave the vue code (under static/vue/*.min.js) unminified, it's make other learn the vue code that integrate with web2py more clearly best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [web2py] Re: ECMAScript Modules Vue and Web2py - simple test
Yeah, you're right, but this structure is intended since I use a deploy script that would clean dev, errors, sessions and other data El vie., 23 de mar. de 2018 22:31, 黄祥 escribió: > yeah, already checked that too, just a suggestion, perhaps better to leave > the vue code (under static/vue/*.min.js) unminified, it's make other learn > the vue code that integrate with web2py more clearly > > best regards, > stifan > > -- > Resources: > - http://web2py.com > - http://web2py.com/book (Documentation) > - http://github.com/web2py/web2py (Source code) > - https://code.google.com/p/web2py/issues/list (Report Issues) > --- > You received this message because you are subscribed to the Google Groups > "web2py-users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to web2py+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [web2py] Re: ECMAScript Modules Vue and Web2py - simple test
In addition to improve learning and testing will create minified and unminified branches El sáb., 24 de mar. de 2018 02:17, Marco Mansilla escribió: > Yeah, you're right, but this structure is intended since I use a deploy > script that would clean dev, errors, sessions and other data > > El vie., 23 de mar. de 2018 22:31, 黄祥 > escribió: > >> yeah, already checked that too, just a suggestion, perhaps better to >> leave the vue code (under static/vue/*.min.js) unminified, it's make other >> learn the vue code that integrate with web2py more clearly >> >> best regards, >> stifan >> >> -- >> Resources: >> - http://web2py.com >> - http://web2py.com/book (Documentation) >> - http://github.com/web2py/web2py (Source code) >> - https://code.google.com/p/web2py/issues/list (Report Issues) >> --- >> You received this message because you are subscribed to the Google Groups >> "web2py-users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to web2py+unsubscr...@googlegroups.com. >> For more options, visit https://groups.google.com/d/optout. >> > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: custom ordering of select results
On Wednesday, March 21, 2018 at 11:21:28 AM UTC-7, Dave S wrote: > > > > On Wednesday, March 21, 2018 at 5:30:08 AM UTC-7, Anthony wrote: >> >> I have a different application, where I want to order the rows according >>> to a string field, where the string field has a prefix and a suffix, and >>> the suffix is the dominant part of the ordering: >>> >>> 4321A < 0123B, >>> 2345D < 5432D >>> >>> >> The simplest and most efficient method is probably to let the database do >> the sorting. In SQLite, you can use the substr() function: >> >> rows = db(query).select(..., orderby='substr(mytable.myfield, -1), >> mytable.myfield') >> >> substr(mytable.myfield, -1) selects the last character of myfield (use >> -2 for the last 2 characters, etc.). Adding mytable.myfield to the orderby >> breaks any ties by ordering based on the beginning characters of the field. >> > > That looks pretty straightforward, once I realize the substr() function is > available =8-0 > > >> >> >>> It's really easy to write a custom cmp() for this, and then to do >>> sorted(rows, >>> mycmp), but the result is a list, not a Rows object; in particular, it >>> loses the colnames. If I do >>> db(query1).select().sort(mycmp), >>> that fails because mycmp() requires 2 arguments, but 1 given. >>> >> >> The "key" function passed to the Python sorted() function should take >> only a single argument -- an element from the iterator being sorted. If >> your mycmp requires two arguments, then it should fail with sorted() as >> well as with Rows.sort(). Just rewrite mycmp so it takes only one argument >> (a Row object). >> > > Ah, the "key" argument. That's what's going on. sorted() has both a cmp > and key argument, and I viewed this as a cmp problem. > > >> >> >>> Or if I use sorted(), how do I turn list back into a Rows object? >>> (Okay, there's a work-around for this ... write the view to handle a list, >>> rather than having a default view, but one of these days I'm bound to need >>> a Rows object.) >>> >> >> Try: >> >> rows.records = sorted(rows, mycmp) >> >> Though, as noted above, rows.sort(mycmp) should work just as well (it >> uses sorted() internally). >> >> Anthony >> > > Thanks, it sounds like I was focusing on the wrong area. I guess I should > have peeked in at rows.sort() to see how it worked. As always, you're on > top of the game. > > Finally got to try this out, and of course tried both the substr() and the records = versions. SQLite3's substr() uses the 3rd argument differently than Python does (length, rather than endpoint), but once I got that sorted out everything was good! Thanks again. /dps "yes, the example was simplified ... omitted the penultimate character" -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.