[web2py] Re: Compiling web2py application to run as a native windows app

2014-07-17 Thread 黄祥
i think you can achieve it using batch file, power shell or autoit (for make *.exe). if you want to use https please create it manually using openssl and put it on the folder. e.g. bat file c:\test\web2py\test.bat @echo off C:\Python27\python.exe web2py.py -c test.crt -k test.key --interfaces=

[web2py] Automatic actions based on date/time

2014-07-17 Thread ceriox
Hello, i need to execute istructions after a specific date and time. for example in a table i have a field called "validity" and it is a date time field the record is valid until this date/time (validity field) , when it is over i need to execute some instruction. (i'm doing a shop for food pro

[web2py] Re: web2py vs others. Status of 2014

2014-07-17 Thread Arnon Marcus
Massimo is right - the future is a fatter client and thinner server (Hell, it's already "the present", or even "the past"...) I like exactly the technologies Massimo mentioned, with some additions. I opened a few google-groups for integration of Ember, Angular and the like, but then life happene

[web2py] Re: Automatic actions based on date/time

2014-07-17 Thread Niphlod
use cron or, even better, the scheduler. On Thursday, July 17, 2014 10:27:09 AM UTC+2, ceriox wrote: > > Hello, > i need to execute istructions after a specific date and time. > > for example in a table i have a field called "validity" and it is a date > time field > the record is valid until thi

[web2py] Re: Automatic actions based on date/time

2014-07-17 Thread ceriox
thanks, can you post an little example or a reference to the manual? sorry i'm not a good programmer :( Il giorno giovedì 17 luglio 2014 11:19:31 UTC+2, Niphlod ha scritto: > > use cron or, even better, the scheduler. > > On Thursday, July 17, 2014 10:27:09 AM UTC+2, ceriox wrote: >> >> Hello, >

[web2py] Re: Trolls at work against web2py!

2014-07-17 Thread lyn2py
Kudos to Massimo for your replies to the comments on Reddit, in spite of their negativity. I have learned more about web2py from your replies. I would help speak up for web2py if I could, but I am considered very young to the history of python frameworks and cannot hold a conversation on that.

[web2py] Re: web2py vs others. Status of 2014

2014-07-17 Thread lyn2py
Hi Massimo, probably a dumb question, but can you explain more why you would want to move the helper system and form generation to clients side? Thanks. When do you foresee that Python 3 will takeover the world by storm and leave Python 2 permanently behind? And when will web3py be ready… heheh

Re: [web2py] Trolls at work against web2py!

2014-07-17 Thread Don O'Hara
If I ignore my bias to web2py, and the fact that I have no empirical evidence as far as real world applications, it is interesting that : - Only Massimo's posts give references to links, other studies, and real evidence, in a calm, unopinionated manner - Detractors tend to give off the

[web2py] Getting "invalid view" when trying to access view as JSON

2014-07-17 Thread John Drake
This is odd. On my local test server I can do something like: http://localhost:8000/myapp/mycontroller/myfunction.json and I get back a JSON document. But when I try the same code on the same application running on Pythonanywhere I get: invalid view (mycontroller/myfunction.json) Just to mak

[web2py] Re: Getting "invalid view" when trying to access view as JSON

2014-07-17 Thread Niphlod
directly from the book - If a view is not found, web2py tries to use a generic view. By default, generic views are disabled, although the 'welcome' app includes a line in /models/db.py to enable them on localhost only. They can be enabled per extension type and per action (usingre

[web2py] form.process(onvalidate=some_function) blocks custom validator?

2014-07-17 Thread Cliff Kachinske
I use a custom validator for list:string fields. If I use onvalidate with form.process, the validator is not called. It's easy to work around this situation, but it took some time to figure out what was going on. It might be beneficial to document this behavior. -- Resources: - http://web2

[web2py] Pinging Massimo: why Bottle as opposed to Flask?

2014-07-17 Thread Cliff Kachinske
Massimo, In the Reddit thread you mentioned experimenting with Bottle + Dal. Why Bottle? Thanks, Cliff Kachinske -- 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 Iss

[web2py] Re: Automatic actions based on date/time

2014-07-17 Thread 黄祥
for cron i think you can learned it from man cron on linux. for scheduler, please take a look at this discussion : https://groups.google.com/forum/#!topic/web2py/EY4UCtTH35A for your case, i think you can create the schedule for check the validity and compare it with the date time right now, aft

[web2py] Re: form.process(onvalidate=some_function) blocks custom validator?

2014-07-17 Thread Leonel Câmara
Do you mean onvalidation? It's supposed to run your validators first. -- 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 yo

[web2py] Re: form.process(onvalidate=some_function) blocks custom validator?

2014-07-17 Thread Cliff Kachinske
It appears not to. If I put a print statement in there it never executes. If I tell it to return the value and some arbitrary string it doesn't happen. On Thursday, July 17, 2014 6:56:41 AM UTC-4, Leonel Câmara wrote: > > Do you mean onvalidation? It's supposed to run your validators first. > >

[web2py] Re: Problem with Google Fonts

2014-07-17 Thread Leonel Câmara
Thiago by removing http it uses whatever protocol you're using. So my solution would also have worked. The reason for your problem is that when you request a webpage using HTTPS the browser blocks non-secure requests so HTTP is blocked. I told you to use https:// instead of just // so it also w

[web2py] Re: web2py vs others. Status of 2014

2014-07-17 Thread Massimo Di Pierro
On Thursday, 17 July 2014 04:50:16 UTC-5, lyn2py wrote: > > Hi Massimo, probably a dumb question, but can you explain more why you > would want to move the helper system and form generation to clients side? > Thanks. > I think it would be nice to have a framework where the server only needs to

[web2py] Re: Pinging Massimo: why Bottle as opposed to Flask?

2014-07-17 Thread Massimo Di Pierro
I find bottle to be small and very well written. Flask started as an April's fool joke and the name was supposed to make fun on Bottle. Flask sells itself as a micro-framework but it has a very large code based given the functionality it provides. If bottle existed when web2py started, I would

[web2py] Re: web2py vs others. Status of 2014

2014-07-17 Thread lyn2py
Ok, thank you for the response. :) On Thursday, July 17, 2014 7:35:16 PM UTC+8, Massimo Di Pierro wrote: > > > > On Thursday, 17 July 2014 04:50:16 UTC-5, lyn2py wrote: >> >> Hi Massimo, probably a dumb question, but can you explain more why you >> would want to move the helper system and form ge

[web2py] Re: Getting "invalid view" when trying to access view as JSON

2014-07-17 Thread lyn2py
Because generic views are used on localhost. For security, production servers will not serve generic files. You either turn off that security (not recommended, do the next thing) or create the individual view files you need for the corresponding function/action in the controller. On Thursday, J

[web2py] Possible SQLCustomType bug with booleans

2014-07-17 Thread Eric
Hi There, Today I needed to use a SQLCustomType to convert a boolean to a string (in view mode) and the other way around when storing it. I used this customtype: bool_to_text = SQLCustomType( type='string', native='boolean', encoder=lambda value: SQLFormFilters.store_text_as_boolean

Re: [web2py] Is it possible to get an _onclick prompt variable to send to the controller?

2014-07-17 Thread Richard Vézina
Yes, but I guess you need to pass it like that : **{'*_onclick*': *"var reason=prompt('Reason for extending?'); return reason;"*} Richard On Wed, Jul 16, 2014 at 8:09 PM, wrote: > Hi all, > > I started using web2py a week ago with little MVC experience. I have a > page displaying a database

Re: [web2py] Relative URLs in development absolute URLs in production

2014-07-17 Thread Richard Vézina
I do that for DB connection : try: if request.env.http_host.split(':')[1] == '8005': raise error # To use shell in prod/staging environnement elif request.env.http_host.split(':')[1] != '': db = DAL('postgres://richard:password@127.0.0.1:5432/db', migrate_

[web2py] Direct editing inside a grid

2014-07-17 Thread Serge Bourgeois
Hello, In order to simplify the user interface of basic controller functions, I want to offer direct editing in SQLFORM.smartgrid, using the same widgets (string, options, uploads, ...) than those available in create or edit. Maybe, I missed the point in the doc? Thank you for any advice. Se

[web2py] Re: Direct editing inside a grid

2014-07-17 Thread Anthony
This is not available out of the box, though it would be nice. Anthony On Thursday, July 17, 2014 10:25:20 AM UTC-4, Serge Bourgeois wrote: > > Hello, > > In order to simplify the user interface of basic controller functions, I > want to offer direct editing in SQLFORM.smartgrid, using the same

[web2py] Re: Possible SQLCustomType bug with booleans

2014-07-17 Thread Anthony
Can't you just use the "represent" attribute for the custom display (and possibly a custom widget if you need special input as well)? What's wrong with your current code? Anthony On Thursday, July 17, 2014 9:29:00 AM UTC-4, Eric wrote: > > Hi There, > > Today I needed to use a SQLCustomType to

[web2py] Re: Compiling web2py application to run as a native windows app

2014-07-17 Thread Anthony
Check out http://web2py.com/books/default/chapter/29/14/other-recipes#How-to-distribute-your-applications-as-binaries. Python modules can go in the site-packages directory (if shared across apps) or in the application's /modules folder. Anthony On Wednesday, July 16, 2014 11:51:36 AM UTC-4, La

[web2py] Re: form.process(onvalidate=some_function) blocks custom validator?

2014-07-17 Thread Anthony
Here's the framework code: status = self._traverse(status, hideerror) status = self.assert_status(status, request_vars) if onvalidation: ._traverse is where individual field validators are run, which happens before onvalidation. We'll probably have to see some code to fi

[web2py] Re: Direct editing inside a grid

2014-07-17 Thread Serge Bourgeois
Thanks Antony!. Do you know if there is any plan to develop such a feature? If yes, do you have any idea of availability ? Still a third question: I tried the idea proposed here : http://www.web2pyslices.com/slice/show/1928/basic-inline-editing-in-sqlformgrid-no-plugin-no-javascript but, I go

[web2py] Re: sessions2trash.py and memory usage

2014-07-17 Thread Annet
@Simone, Thanks for your reply and explanation of cron and cleaning up sessions. > PS: you definitely DO NOT want to schedule apache on cron > That's what Webfaction's install script for Web2py does by default, also they keep telling me: But note that cron jobs are better for such periodic t

[web2py] Weird bug using a computed field and then having an update using expressions

2014-07-17 Thread Leonel Câmara
If I do this my computed field (that depends on score and created on) is updated correctly: def some_other_table_after_insert(f, id): record = db.table_with_computed_field[f['ref']] new_score = record.score + f['score'] record.update_record(score=new_score, created_on=record.created_o

[web2py] Embedding an html string in a component

2014-07-17 Thread Jim S
I don't think my problem is really web2py related but was hoping someone here might have done this already. The attached file is the html representation of an email. I want to embed and display that file within my page. Actually it is a load'd component. I don't want it displayed verbatim, I w

[web2py] SQLFORM doesn't have SELECT element values

2014-07-17 Thread Frank Buibish
So I'm trying to build a multiple select box where i move things from a select box on the left and put them on the right. I have the values moving correctly through javascript but when i submit the form it doesn't pick up the value in the form.vars. forms = dict() forms[0] = SQLFORM(d

[web2py] Re: Direct editing inside a grid

2014-07-17 Thread Anthony
I don't have time to look into it, but seeing some code and a traceback might help. Anthony On Thursday, July 17, 2014 12:18:39 PM UTC-4, Serge Bourgeois wrote: > > Thanks Antony!. Do you know if there is any plan to develop such a > feature? If yes, do you have any idea of availability ? > >

[web2py] Re: SQLFORM doesn't have SELECT element values

2014-07-17 Thread Anthony
Is the value available in request.post_vars.selections? On Thursday, July 17, 2014 3:37:38 PM UTC-4, Frank Buibish wrote: > > So I'm trying to build a multiple select box where i move things from a > select box on the left and put them on the right. I have the values moving > correctly through

[web2py] Re: Embedding an html string in a component

2014-07-17 Thread Anthony
You can extract just the DIV and return it as the HTML of the component. As for the CSS, technically that should probably go in the head element of the parent page, but I think most browsers will still recognize it if you put it elsewhere (e.g., within the returned component HTML). Anthony On

[web2py] Re: Embedding an html string in a component

2014-07-17 Thread Jim S
Thanks Anthony, I'll give that a try. -Jim On Thursday, July 17, 2014 3:14:59 PM UTC-5, Anthony wrote: > > You can extract just the DIV and return it as the HTML of the component. > As for the CSS, technically that should probably go in the head element of > the parent page, but I think most br

[web2py] Re: Weird bug using a computed field and then having an update using expressions

2014-07-17 Thread Anthony
A computed field must be given actual values with which to compute, as the final value is computed by web2py and then inserted into the DB. Your second example uses expressions to express the values to be inserted in the score and created_on fields. However, these expressions will ultimately be

[web2py] Re: form.process(onvalidate=some_function) blocks custom validator?

2014-07-17 Thread Cliff Kachinske
I've worked around it, so not a concern at this very moment. If I ever get out of crunch time I"ll look into it. Cliff Kachinske On Thursday, July 17, 2014 11:59:57 AM UTC-4, Anthony wrote: > > Here's the framework code: > > status = self._traverse(status, hideerror) > status =

Re: [web2py] Re: can web2py expose coffee files to allow source maps ?

2014-07-17 Thread António Ramos
@Massimo, any news about exposing source maps so i can debug coffeescript files in the browser? Thanks 2014-07-12 13:17 GMT+01:00 António Ramos : > The link has a transcription to text of the video comments > Em 12/07/2014 08:49, "Massimo Di Pierro" > escreveu: > > What does the video say? Ca

[web2py] Re: Embedding an html string in a component

2014-07-17 Thread Jim S
Thanks Anthony, that worked. Now I just have to figure out how to get the images to display as well. -Jim On Thursday, July 17, 2014 3:16:18 PM UTC-5, Jim S wrote: > > Thanks Anthony, I'll give that a try. > > -Jim > > On Thursday, July 17, 2014 3:14:59 PM UTC-5, Anthony wrote: >> >> You can ex

[web2py] DAL - compare datetime field to a date

2014-07-17 Thread Jim S
I have a field setup as: Field('needed','datetime') In my query I want to get a list of all workorders where the needed field occurs today. So, something like this: workorders = db(db.workorder.needed==request.today).select() I know this doesn't work but this it shows what I'm looking for. -

[web2py] Re: DAL - compare datetime field to a date

2014-07-17 Thread 黄祥
had you already tried request.now? workorders = db(db.workorder.needed == request.now).select() ref: http://web2py.com/books/default/chapter/29/04/the-core#request best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (

[web2py] Re: Embedding an html string in a component

2014-07-17 Thread Anthony
The image source is shown as src="cid:image001.png@01CFA1BC.429B6EC0". You'll need to save the image separately and service it as a static file, changing the src attribute accordingly. Anthony On Thursday, July 17, 2014 5:24:16 PM UTC-4, Jim S wrote: > > Thanks Anthony, that worked. Now I just

[web2py] Re: DAL - compare datetime field to a date

2014-07-17 Thread Jim S
Yes. Sorry, that was a typo in my description. I was using request.now. The problem is that gives a datetime so the datetime would not be equal. What I've done now is this: start = parse('%s 00:00:00' % (request.now.strftime('%Y-%m-%d'))) end = parse('%s 23:59:59' % (request.no

[web2py] Re: SQLFORM doesn't have SELECT element values

2014-07-17 Thread Frank Buibish
It does not just says none -- 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 "web

[web2py] problem with request_reset_password routes on server

2014-07-17 Thread Júlia Rizza
Hello, I have a controller called 'painel.py' and the following config in my *db.py* file: ## configure auth policy auth.settings.mailer=mail auth.settings.controller = 'painel' auth.settings.actions_disabled.append('register') auth.settings.registration_requires_verification = False auth.setting

[web2py] Re: SQLFORM doesn't have SELECT element values

2014-07-17 Thread Anthony
What does the final form HTML end up looking like in the web page? On Thursday, July 17, 2014 8:39:26 PM UTC-4, Frank Buibish wrote: > > It does not just says none > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https

[web2py] Re: SQLFORM doesn't have SELECT element values

2014-07-17 Thread Frank Buibish
Title: How long is this workout?: Add Exercise + Bench Kettle Bell Breathing Squat Zercher Squat

[web2py] Re: SQLFORM doesn't have SELECT element values

2014-07-17 Thread Anthony
The first select has no name, and the second one has no options. -- 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

[web2py] Re: SQLFORM doesn't have SELECT element values

2014-07-17 Thread Frank Buibish
Bench They get added through javascript from the first select element. On Thursday, July 17, 2014 10:14:17 PM UTC-4, Anthony wrote: > > The first select has no name, and the second one has no options. > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://gith

Re: [web2py] Re: Direct editing inside a grid

2014-07-17 Thread Manuele Pesenti
Il 17/07/14 18:18, Serge Bourgeois ha scritto: > but, I got a message saying that I couldn't change the objects already > existing ... look for a validator... in case you are using IS_NOT_IN_DB it happens that when you're not updateing a value in a field with this validator but other, because of th