[web2py] Re: Translate Controller names and Function names

2015-01-28 Thread Jonathan Lundell
There's also the alternative of embedding a language code in the URL and not translating the URL elements. The parameter-based routing system already supports that, and it would give you separate search-engine indexing. On Tuesday, January 27, 2015 at 4:12:42 AM UTC-8, Francisco Costa wrote: >

[web2py] Re: Translate Controller names and Function names

2015-01-27 Thread Jonathan Lundell
I think that Niphlod is probably right, though I might be inclined to stick with your programmatic logic rather than use pattern-based routing. And maybe write a wrapper for URL() so that all the logic is in the same place and driven off the same tables. On Tuesday, January 27, 2015 at 4:12:42

[web2py] Re: RSVP: Massimo @ Bay Area web2py meetup (refreshments) -- 12/5/2014, 6:30PM - 9:00PM -- BE THERE!!!

2014-11-09 Thread Jonathan Lundell
I'm in. On Wednesday, November 5, 2014 11:48:14 PM UTC-8, weheh wrote: > > Hi Bay Area web2py'ers. Get excited! > > *Massimo will attend our very own Bay Area* *web2py meetup* to meet, > greet and present. Additional talks are planned. Details follow: > > Date: *Friday, December 5* > Time: *6:30P

[web2py] Re: web2py meetup Bay Area

2014-09-10 Thread Jonathan Lundell
I'm down in the Half Moon Bay area, spend some time in the valley. Meetup'd be fun. On Wednesday, September 10, 2014 1:08:58 PM UTC-7, Massimo Di Pierro wrote: > > I agree. I come often to SF. I will be there again at the end of November. > Let me know what I can do to help. > > On Wednesday, 10

Re: [web2py] invalid request error when the url address contains special characters.

2014-07-26 Thread Jonathan Lundell
On 26 Jul 2014, at 1:27 AM, kenny c wrote: > I have a website link that has special characters in it, e.g) > www.asdfasdf.com/5%pic.jpg If I try to open this link, I get "invalid > request" error. > The reason that the link ends with jpg extension is that I am creating a jpg > file with a Pytho

Re: [web2py] Re: truly global/single instance variable

2014-07-26 Thread Jonathan Lundell
On 26 Jul 2014, at 7:13 AM, lucas wrote: > i have it in a module and under that module i have the variable setup as a > global variable. wherein, if the variable is empty upon using it, i load the > list of lists from a text file. if it is not empty, then i just use it. so > in that case, is

Re: [web2py] redirect(URL('second',vars=dict(name=name)))..could somebody explain this in details thank

2014-07-07 Thread Jonathan Lundell
On 6 Jul 2014, at 7:04 PM, Bazida wrote: > Hi, I was doing some tutorial from the web2py book, i ran into this following > code > > def first(): > form = SQLFORM.factory(Field('visitor_name', requires=IS_NOT_EMPTY())) > if form.process().accepted: > name = form.vars.visitor_name

Re: [web2py] Re: global name 'db' is not defined

2014-05-27 Thread Jonathan Lundell
On 27 May 2014, at 6:21 AM, Henrik Holm wrote: > On Tuesday, May 27, 2014 8:46:19 AM UTC-4, Anthony wrote: > > I suppose we could add a setting that allows you to specify model order, > though for backward compatibility, the initial model file (i.e., the one > where you make that setting) woul

Re: [web2py] Re: Display table as dictionary

2014-05-04 Thread Jonathan Lundell
On 4 May 2014, at 9:46 PM, Massimo Di Pierro wrote: > fields = db(db.address.business==4L).select().first().as_dict() AttributeError: 'NoneType' object has no attribute 'as_dict' (just sayin'...) > > On Sunday, 4 May 2014 16:59:34 UTC-5, Greg Vaughan wrote: > > The following code > > fields

Re: [web2py] Illegal character in encryption salt

2014-04-13 Thread Jonathan Lundell
On 11 Apr 2014, at 6:38 AM, Louis Amon wrote: > I'm trying to migrate from another framework to web2py but can't make any of > the previous user accounts work : passwords don't match even tho I have the > correct salt and algorithm. > > After much research, I think the issue is in the way web2p

Re: [web2py] Re: URL of an external website

2014-03-29 Thread Jonathan Lundell
On 29 Mar 2014, at 5:04 AM, villas wrote: > My point was simply this: if I set a='myapp' I would expect 'myapp' to > replace the appname from r or anywhere else. > This behaviour also caused difficulty for the OP. > I just mentioned it in case it was a bug. Thanks for commenting. Sadly, it

Re: [web2py] Re: URL of an external website

2014-03-28 Thread Jonathan Lundell
On 28 Mar 2014, at 6:35 AM, villas wrote: > >>> URL(a='a',c='c',f='f') > '/a/c/f' > > >>> URL(a='a',c=' ',f=' ') > '/a/ / ' > > >>> URL(a='a') > '/APPNAME/a' > > >>> URL(a='a',c='',f='') > '/APPNAME/a' > > > In the last two commands, APPNAME appears. Why? That's looks like a bug. > > @Jon

Re: [web2py] URL of an external website

2014-03-27 Thread Jonathan Lundell
On 27 Mar 2014, at 6:49 AM, Louis Amon wrote: > I'm trying to use the URL() function to connect to an external website's API, > thus benefitting from web2py's HTML entity encoding feature. > > I wrote something like this : > > URL(scheme='http', domain='www.example.org', a='API', vars={'localit

Re: [web2py] Crash in gluon/html.py

2014-03-24 Thread Jonathan Lundell
On 24 Mar 2014, at 6:04 AM, Chris Hobbs wrote: > html.py does not seem to be unicode-safe. It contains (line 1914 or > thereabouts): > > components.append(OPTION(c, _value=str(c))) > > In my case c contains Max-Guénaël (i.e., u"Max-Gu\xe9na\xebl"). The str(c) > dies nastily. > > Is this a bug

Re: [web2py] Re: Crash in gluon/html.py

2014-03-24 Thread Jonathan Lundell
On 24 Mar 2014, at 10:45 AM, Massimo Di Pierro wrote: > The convention in web2py is NO UNICODE. all text handled by web2py must be > UTF8 encoded strings. Though there are quite a few instances of html.py taking explicit notice of unicode (search for 'unicode'...). > > On Monday, 24 March 20

Re: [web2py] Python Performance Issue

2014-03-17 Thread Jonathan Lundell
On 17 Mar 2014, at 9:21 AM, horridohobbyist wrote: > WTF. Now, both Apache and Gunicorn are slow. Equally slow! > I really think it'd simplify matters to reproduce this outside the context of a web server. If the problem is really the GIL, then all these environment are doing is using a web se

Re: [web2py] Re: URL with all current args and vars

2014-03-16 Thread Jonathan Lundell
On 16 Mar 2014, at 9:49 PM, Anthony wrote: > URL(f=request.function, args= request.args, vars=request.vars, language='it') > > > URL does now take a "language" argument (in the current version of web2py). > You can also try: > > request.uri_language = 'it' > > to force a different language to

Re: [web2py] Re: Python Performance Issue

2014-03-16 Thread Jonathan Lundell
On 16 Mar 2014, at 1:31 PM, horridohobbyist wrote: > Well, I managed to get gunicorn working in a roundabout way. Here are my > findings for the fred.py/hello.py test: > > Elapsed time: 0.028 > Elapsed time: 0.068 > > Basically, it's as fast as the command line test! > > I'm not sure this tell

Re: [web2py] Re: Python Performance Issue

2014-03-15 Thread Jonathan Lundell
On 15 Mar 2014, at 7:45 PM, Massimo Di Pierro wrote: > Could it be the GIIL. web2py is a multi-threaded app. Are the threads created > by the web server doing anything? > What if you use a non-threaded server like gunicorn instead? > I believe that Niphlod reproduced the problem with Rocket, i

Re: [web2py] Python Performance Issue

2014-03-15 Thread Jonathan Lundell
On 15 Mar 2014, at 8:19 AM, Niphlod wrote: > @mcm: you got me worried. Your test function was clocking a hell lower than > the original script. But then I found out why; one order of magnitude less > (5000 vs 5). Once that was corrected, you got the exact same clock times > as "my app" (i.e

Re: [web2py] Re: Python Performance Issue

2014-03-14 Thread Jonathan Lundell
On 14 Mar 2014, at 9:13 PM, Mariano Reingart wrote: > Is web2py bytecode compiled? > .pyo or .pyc appears in gluon folder? > Maybe in tour production server there is some permission/date issue and .pyc > files cannot be saved, so they are compiled on each run (that takes time). > But the compil

Re: [web2py] Re: Python Performance Issue

2014-03-14 Thread Jonathan Lundell
On 14 Mar 2014, at 2:16 PM, Jonathan Lundell wrote: > On 14 Mar 2014, at 2:03 PM, Niphlod wrote: >> So seems that web2py shell and python script behaves exactly the same >> (if web2py was introducing complexity it should show right there). >> The same environment execut

Re: [web2py] Re: Python Performance Issue

2014-03-14 Thread Jonathan Lundell
On 14 Mar 2014, at 2:03 PM, Niphlod wrote: > So seems that web2py shell and python script behaves exactly the same (if > web2py was introducing complexity it should show right there). > The same environment executed by rocket or uwsgi gets some gap (roughly 2x > time). > uwsgi behaves a litt

Re: [web2py] Re: Python Performance Issue

2014-03-14 Thread Jonathan Lundell
On 14 Mar 2014, at 11:28 AM, horridohobbyist wrote: > First, I don't know how to use the profiler. > > Second, for something as trivially simple as the Welcome app with the > calculation loop, what is the profiler going to tell us? That simple > multiplication and division are too slow? That th

Re: [web2py] web2py on Mac OS Mavericks, trying to use port 80

2014-03-14 Thread Jonathan Lundell
On 13 Mar 2014, at 11:34 PM, audion...@gmail.com wrote: > It seems this is related to Mac OS policy to keep use of some ports for it's > own usage. > My question is wether this is a bug or an enhancement request to have an > error message in the graphical web2py launch app to inform user ? > (Whe

Re: [web2py] Re: Python Performance Issue

2014-03-14 Thread Jonathan Lundell
On 14 Mar 2014, at 8:59 AM, horridohobbyist wrote: > I disagree. I'm getting very consistent results with time.time(). Right, I see no problem with the experiment. And the arguments to debug() must be computed before debug() gets called, so no problem there either. > > With a print statement,

Re: [web2py] Re: Python Performance Issue

2014-03-14 Thread Jonathan Lundell
you clock time, and that can lead to very random results in a shared-hardware environment. Or even in a non-shared one, if there's any other system activity going on. The only way around that is to repeat the experiment a lot (which you're doing, sounds like). > > > On Friday

Re: [web2py] Re: Python Performance Issue

2014-03-14 Thread Jonathan Lundell
On 14 Mar 2014, at 6:28 AM, horridohobbyist wrote: > I conducted a simple experiment. I took the "Welcome" app, surely the > simplest you can have (no databases, no concurrency, etc.), and added the > following to the index page: > > def test(): > start = time.time() > x = 0.0 > for

Re: [web2py] Python Performance Issue

2014-03-13 Thread Jonathan Lundell
n I tried to incorporate the code into web2py, I > found a namespace clash (class Package appears elsewhere in the web2py > installation). I resolved this by renaming the module file. Otherwise, there > should be no difference between command line execution and web2py execution. > > T

Re: [web2py] Python Performance Issue

2014-03-13 Thread Jonathan Lundell
On 13 Mar 2014, at 12:48 PM, horridohobbyist wrote: > I have a rather peculiar Python performance issue with web2py. I'm using > pyShipping 1.8a (from http://pydoc.net/Python/pyShipping/1.8a/). The > standalone program from the command line works quickly. However, after I've > incorporated the

Re: [web2py] Re: reconnecting to the database

2014-03-11 Thread Jonathan Lundell
On 11 Mar 2014, at 9:39 AM, Massimo Di Pierro wrote: > is db.commit() not enough? It should release all locks. I wasn't sure, but that'd be easier, yes. Is a lock reacquired automatically, if I (say) do a table.update()? > > > On Tuesday, 11 March 2014 11:01:48 UTC-5,

[web2py] reconnecting to the database

2014-03-11 Thread Jonathan Lundell
In a controller, what's the best way to: a) access the db b) close the db c) do something that might take a few seconds d) reconnect to the db e) update the db It's steps b & d that I'm asking about; I don't want to hold any database locks during c. I'm currently using BaseAdapter.close_all_in

Re: [web2py] Re: How to render a returned json

2014-03-04 Thread Jonathan Lundell
On 4 Mar 2014, at 9:19 AM, Avi A wrote: > I do the same I get: > TypeError: string indices must be integers, not str > > Try catching that exception and printing the object you're working with. It sounds like you're indexing the json string (r.content) rather than the result of json.loads. >

Re: [web2py] How to render a returned json

2014-03-04 Thread Jonathan Lundell
x27;, u'url': u'http://www.pivotaltracker.com/story/show/66856110', u'created_at': u'2014-03-04T13:31:33Z', u'labels': [{u'kind': u'label', u'name': u'label', u'created_at': u'2014-03-04T10:39:

Re: [web2py] How to render a returned json

2014-03-04 Thread Jonathan Lundell
On 4 Mar 2014, at 5:35 AM, Avi A wrote: > Hi, > I'm getting on a controller a json response as expected, and I didn't find a > way how to parse it yet: json.loads(r.content) will convert it to a dict. > > r = requests.post(url, data=json.dumps(payload), headers=headers) > r.content returns som

Re: [web2py] help with jsonrpc

2014-03-01 Thread Jonathan Lundell
On 1 Mar 2014, at 11:46 AM, Trevor Overman wrote: > So I'm trying to connect an android application to my web2py website back end > database by using json remote procedure calls. > Currently, I am trying to make a simple test function to remotely add entries > in the db. > Additionally, I am run

Re: [web2py] Is it possible to execute {{code}} from database?

2014-02-22 Thread Jonathan Lundell
On 22 Feb 2014, at 3:31 PM, Robin Manoli wrote: > Suppose db.page.content has some text like : {{ arbitrary python code }}. > Would this python code then be executed? Is it possible to execute such code? > > Assuming that the code is a valid web2py template, I think you could set response.vie

Re: [web2py] Re: how to get globals like "request" available in my own modules ?

2014-02-18 Thread Jonathan Lundell
On 18 Feb 2014, at 10:15 AM, Anthony wrote: > What's the difference between your method and doing: > > In mymodule.py: > > from gluon import current > > def helper(): > current.request.get('variable', ...) > > In a model file: > > from mymodule import helper > from gluon import current >

Re: [web2py] Absolute URL issue in PythonAnywhere when using scheduled script

2014-02-15 Thread Jonathan Lundell
On 15 Feb 2014, at 7:49 AM, Ykä Marjanen wrote: > I got the scheduled background script working in PA. The script is started in > web2py environment with -S app and -M -R parameters. The script generates > emails, which include links (e.g. registration link with UUID). > > I use scheme=True and

Re: [web2py] web2py, virtual domains and routes.py

2014-02-10 Thread Jonathan Lundell
On 10 Feb 2014, at 6:51 AM, Mauro Allegrini wrote: > Hi all > I'm trying to use virtual domains and a single web2py instance with multiple > apps, > My host is pythonanywhere.com. They have been kind but unable to help me on > this and suggested me to ask here. > > I've created PA domains, I'v

Re: [web2py] Re: login_next and next var

2014-02-04 Thread Jonathan Lundell
On 4 Feb 2014, at 10:32 AM, Annet wrote: > Notice extra ' before 'URL > > When I remove the ' ' around the URL > > Login > > The button is rendered the following way: > > Login > > The first =URL converted to a url the second =URL is not. > > Is what I want not possible? It's a URL; it's

Re: [web2py] byte-compiled routes.py supported?

2014-02-03 Thread Jonathan Lundell
On 3 Feb 2014, at 1:30 AM, step wrote: > Is using a byte-compiled routes.pyc supported? In my tests when I place just > routes.pyc into web2py-trunk and start the server I get an invalid request > due to mismatched routing. Then if I replace routes.pyc with routes.py and > restart the server ev

Re: [web2py] Re: Email and PGP

2014-01-30 Thread Jonathan Lundell
On 30 Jan 2014, at 8:16 PM, horridohobbyist wrote: > Whoops, I goofed! I didn't realize that Python is interpreted into byte code > files (.pyc). So the changes I made in tools.py didn't actually get run. I > don't know how to convert tools.py into .pyc. Just restart web2py, and then check that

Re: [web2py] issue with external cron

2014-01-24 Thread Jonathan Lundell
On 24 Jan 2014, at 6:54 PM, Jonathan Lundell wrote: > On 24 Jan 2014, at 4:05 PM, Alex wrote: >> could you give more details? why do you start it that way, did you >> experience any problems with external cron? how does the command for the >> system cron exactly look l

Re: [web2py] issue with external cron

2014-01-24 Thread Jonathan Lundell
n/activate && cd %(web2pydir)s && python web2py.py -J -M -S %(appname)s/tasks/idf -a "" >> /tmp/cron.output 2>&1 > > thanks > > On Saturday, January 25, 2014 12:55:50 AM UTC+1, Jonathan Lundell wrote: > On 24 Jan 2014, at 3:38 PM, Alex wro

Re: [web2py] issue with external cron

2014-01-24 Thread Jonathan Lundell
On 24 Jan 2014, at 3:38 PM, Alex wrote: > I've got a big issue with external cron jobs. In my application I've added > tasks to crontab which should be executed every day, e.g. > 0 0 * * * myapp *applications/myapp/cron/task_update_vacation_days.py > 30 0 * * * myapp *applications/myap

Re: [web2py] routes does not working and there is nor file call routes.py in web2py folder (web2py/)!

2014-01-24 Thread Jonathan Lundell
On 24 Jan 2014, at 12:28 AM, Laxmikant Metri wrote: > I created form application in web2py I wanted to make it as default. but > I renamed routes.example.py in form folder into routes.py and done chages > like this > routers = { > app: dict( > default_language = possible_languag

Re: [web2py] request.uri_language

2014-01-15 Thread Jonathan Lundell
On 13 Jan 2014, at 7:48 AM, Gael Princivalle wrote: > That's a good solution, thanks. > > In the meantime I've found that you have to specify with C=...the controller > and f=... the functiuon in the URL helper. > > That like that it works fine: > {{response.menu.append(('IT', False, URL('it',

Re: [web2py] Re: request.uri_language

2014-01-13 Thread Jonathan Lundell
ht work, but only because the rewrite code is more clever than I remember. > > Thanks again for your help. > > Il giorno lunedì 13 gennaio 2014 16:22:50 UTC+1, Jonathan Lundell ha scritto: > On 13 Jan 2014, at 7:00 AM, Gael Princivalle wrote: > > Thanks Alan, Jona

Re: [web2py] Re: request.uri_language

2014-01-13 Thread Jonathan Lundell
On 13 Jan 2014, at 7:00 AM, Gael Princivalle wrote: > Thanks Alan, Jonathan. > > I've test more this simple solution: > routers = dict( > BASE = dict(default_application=' > test'), > test = dict(languages=['en', 'it'], default_language='it'), > ) > > And it works fine for me. > > The

Re: [web2py] rocket-server and --interface

2014-01-13 Thread Jonathan Lundell
On 13 Jan 2014, at 6:10 AM, Jonathan Lundell wrote: > On 13 Jan 2014, at 5:28 AM, Martin Weissenboeck wrote: >> What I want to have: >> >> A website, which could be accessed by the https-protocoll (for the >> administration) and by the http-protokoll (as

Re: [web2py] rocket-server and --interface

2014-01-13 Thread Jonathan Lundell
On 13 Jan 2014, at 5:28 AM, Martin Weissenboeck wrote: > What I want to have: > > A website, which could be accessed by the https-protocoll (for the > administration) and by the http-protokoll (as service for some ip-phones). > > > I have tried: > > nohup /usr/local/bin/python2.7 web2py.py -a

Re: [web2py] Re: request.uri_language

2014-01-12 Thread Jonathan Lundell
On 12 Jan 2014, at 8:27 AM, Alan Etkin wrote: > I've got this server error: > 200 Error > > > My bad, unless you have specified the name or it is available in that scope, > using app, test or whatever would raise a NameError. Perhaps it can be solved > using a string ("test") for the dictionar

Re: [web2py] Re: request.uri_language

2014-01-12 Thread Jonathan Lundell
On 12 Jan 2014, at 7:51 AM, Gael Princivalle wrote: > And this routes.py in test folder: > from fileutils import abspath > from languages import read_possible_languages > possible_languages = read_possible_languages(abspath('applications', test)) > routers = { > test: dict( > default_l

Re: [web2py] help with request

2014-01-10 Thread Jonathan Lundell
On 10 Jan 2014, at 12:16 AM, Tarun Kumar wrote: > Hi! people I am new to web2py and web development. I am a bit confused about > the request object. In its variables which can be accessed by > request.vars.variable_name are the values stored only for the most recent > request or for all the pas

Re: [web2py] Re: need help for rewrite on routes.py

2014-01-06 Thread Jonathan Lundell
On 6 Jan 2014, at 1:55 PM, galoshes wrote: > Hello, I would like to revive this older thread (which also relates to this > one:https://groups.google.com/forum/#!topic/web2py/ff1syTIl12o). > > I'm new to web2py, and so far have been finding my way around ok (thanks to > the excellent docs), but

Re: [web2py] routes.py Problem

2014-01-06 Thread Jonathan Lundell
On 6 Jan 2014, at 1:17 AM, Rockiger wrote: > Hi Jonathan, > > many thanks for the answer: > > Here ist mit request object: http://pastie.org/8605943 > > The URL ist http://rockiger.com/de/domainfactory/kontoeroeffnung. > > It seems there is a variable request.uri_language: de in that case. >

Re: [web2py] Re: "invalid request" with a simple view

2014-01-05 Thread Jonathan Lundell
On 5 Jan 2014, at 11:53 AM, Anthony wrote: > On Sunday, January 5, 2014 10:52:42 AM UTC-5, pythonic...@gmail.com wrote: > I'm starting at the start with trying to understand the structure of web2py > and how it all fits together (reading books doesn't work for me). > > I think you should conside

Re: [web2py] routes.py Problem

2014-01-05 Thread Jonathan Lundell
On 5 Jan 2014, at 8:44 AM, Rockiger wrote: > Hello together, > > I have a problem with routes.py. My goal is it to have a English and a German > (de) version of my site: > > I have the following code in there: > > routers = dict( > # base router > BASE = dict( > default_applica

Re: [web2py] Re: Copyright with current year in footer - automatic updating - suggestion.

2014-01-01 Thread Jonathan Lundell
On 1 Jan 2014, at 8:25 AM, Katie Fairbank wrote: > Annet - Would you be so kind as to advise me on what code i need (and where > to add it) so that my copyright year will auto update? I use google sites to > post printer ready recipes (ie - > https://sites.google.com/site/mkfairbank/coconutmac

Re: [web2py] Re: create doc files

2013-12-30 Thread Jonathan Lundell
On 30 Dec 2013, at 7:31 AM, Anthony wrote: > Sorry, a couple mistakes in the code. This should do it: There's a pyrtf example in the book that uses a helper (dumps) and apparently returns a string. I wonder whether the

Re: [web2py] only last item on the dict is rendered.

2013-12-27 Thread Jonathan Lundell
just display member and see what's in it. > > On Saturday, December 28, 2013 12:35:54 AM UTC+2, Jonathan Lundell wrote: > On 27 Dec 2013, at 2:20 PM, Avi A wrote: >> Now I am able to get the list as you suggested with append. >> But i don't know how to render it.

Re: [web2py] only last item on the dict is rendered.

2013-12-27 Thread Jonathan Lundell
rent page for modifying subscription.) > > > On Friday, December 27, 2013 8:54:34 PM UTC+2, Jonathan Lundell wrote: > On 27 Dec 2013, at 10:53 AM, Avi A wrote: >> for case my_org is empty i wrote: >> if my_org: >> not good enough? (if not empty?) > > If that happens

Re: [web2py] only last item on the dict is rendered.

2013-12-27 Thread Jonathan Lundell
On 27 Dec 2013, at 10:53 AM, Avi A wrote: > for case my_org is empty i wrote: > if my_org: > not good enough? (if not empty?) If that happens, what does the view see? > > > On Friday, December 27, 2013 8:37:55 PM UTC+2, Jonathan Lundell wrote: > On 27 Dec 2013, at 1

Re: [web2py] only last item on the dict is rendered.

2013-12-27 Thread Jonathan Lundell
ame )) > > > On Friday, December 27, 2013 8:12:15 PM UTC+2, Jonathan Lundell wrote: > On 27 Dec 2013, at 9:53 AM, Avi A wrote: >> Hi, >> I'm doing something like that: >> if auth.user: >> my_org = db(db.t_org_members.f_org_member ==

Re: [web2py] only last item on the dict is rendered.

2013-12-27 Thread Jonathan Lundell
On 27 Dec 2013, at 9:53 AM, Avi A wrote: > Hi, > I'm doing something like that: > if auth.user: > my_org = db(db.t_org_members.f_org_member == > auth.user.id).select(db.t_org_members.f_org_rep) > if my_org: > for m in my_org: > my_org_members = db(d

Re: [web2py] Apostrophe's disapperaing

2013-12-17 Thread Jonathan Lundell
On 17 Dec 2013, at 3:32 PM, Dave S wrote: > On Monday, December 16, 2013 7:15:12 AM UTC-8, Jonathan Lundell wrote: > On 16 Dec 2013, at 2:18 AM, peter wrote: >> I am impressed at how helpful you have been on this Jonathon. >> >> It does say in the mht file that it

Re: [web2py] Re: Password Transmitted in plain text

2013-12-17 Thread Jonathan Lundell
On 17 Dec 2013, at 2:28 PM, P T wrote: > Thank you Leonel and Jonathan, > > But, thees lines require that I run a https server. Can we configure Rocket > server for https or should I deploy something like Apache? Rocket supports SSL if the ssl module is available on the system. You'll need a c

Re: [web2py] Password Transmitted in plain text

2013-12-17 Thread Jonathan Lundell
On 17 Dec 2013, at 2:08 PM, P T wrote: > I deployed a small app on the intranet and noticed that the username and > password are transmitted in plain text (using a tool WireShark, > http://www.wireshark.org/). > > Here is my setup: > 2.8.2-stable+timestamp.2013.11.28.13.54.07 > (Running on Roc

Re: [web2py] Apostrophe's disapperaing

2013-12-16 Thread Jonathan Lundell
On 16 Dec 2013, at 2:18 AM, peter wrote: > I am impressed at how helpful you have been on this Jonathon. > > It does say in the mht file that it is windows-1252 encoded. > > It turns out that > s.decode('cp1252').encode('utf-8') > > is working correctly. I mistakenly thought it was not >

Re: [web2py] Re: Proposal - use the value of an environment variable as a path_prefix

2013-12-14 Thread Jonathan Lundell
On 14 Dec 2013, at 2:23 PM, Massimo Di Pierro wrote: > Please open a ticket about this proposal. I wonder if a more general solution might not be to have the router accept a regex for path_prefix, strip it from the incoming URL, and save it (say) as request.path_prefix. The outgoing URL rewrit

Re: [web2py] routes.py URL rewriting

2013-12-13 Thread Jonathan Lundell
On 13 Dec 2013, at 12:01 PM, Gael Princivalle wrote: > I've read a lot of literature about routes.py, it's amazing how it can be > powerful and complex. > However for my simple needs I don't reach to find the solution. > > In my web2py root folder I have this routes.py, using the parameter-based

Re: [web2py] Apostrophe's disapperaing

2013-12-13 Thread Jonathan Lundell
h a Web Options button. That button give me a dialog with several tabs. One of the tabs is Encoding, which lets me save as UTF-8 (and set the default to UTF-8). Hopefully Word for Windows has something similar. > > Peter > > On Friday, 13 December 2013 02:20:31 UTC, Jonathan Lund

Re: [web2py] Re: Fail to recognize json payload in a content-type: application/json POST request

2013-12-12 Thread Jonathan Lundell
On 12 Dec 2013, at 2:13 PM, Vincent Audebert wrote: > @Niphlod yes it's exactly this. > > @Jonathan I am on 2.5.1 too and it works fine on my MAC OS X machine but once > I go on a web2py running under apache, the header content_type is sent and > web2py catches only http_content_type > > I wi

Re: [web2py] Apostrophe's disapperaing

2013-12-12 Thread Jonathan Lundell
On 12 Dec 2013, at 6:12 PM, Jonathan Lundell wrote: > On 12 Dec 2013, at 4:16 PM, peter wrote: >> I have a word document that I output as a .'.mht; file ie, a 'single file >> web page'. >> >> I can put sections of this into a string field in a databas

Re: [web2py] Apostrophe's disapperaing

2013-12-12 Thread Jonathan Lundell
On 12 Dec 2013, at 4:16 PM, peter wrote: > I have a word document that I output as a .'.mht; file ie, a 'single file > web page'. > > I can put sections of this into a string field in a database and then display > the field through a view, and the formatting in the word document is > preserve

Re: [web2py] Re: Fail to recognize json payload in a content-type: application/json POST request

2013-12-12 Thread Jonathan Lundell
On 12 Dec 2013, at 2:34 AM, Niphlod wrote: > it should have been. If you're still experiencing issues please post your > findings. Do you recall what the issue was? I'm curious, because I have a 2.5.1 server at the moment serving up application/json. > > On Thursday, December 12, 2013 2:46:51

Re: [web2py] Re: Import from csv file with original id's

2013-12-09 Thread Jonathan Lundell
On 9 Dec 2013, at 8:09 AM, Gael Princivalle wrote: > Thanks Anthony but in any case I've got the same web2py answer: > 'DAL' object has no attribute 'products' > > How is it possible ? Try doing your drop in a separate request. My guess is that you need to trigger a migrate cycle after the dro

Re: [web2py] URL Routing question re: setting persistent arguments for use in controller functions

2013-12-08 Thread Jonathan Lundell
On 8 Dec 2013, at 8:43 AM, Jonathan Lundell wrote: > On 8 Dec 2013, at 12:46 AM, Henry Nguyen wrote: > >> I have an application in which users can have sub_users. Within the app, a >> user can select a sub_user, at which point, all controls become targeted to >> tha

Re: [web2py] URL Routing question re: setting persistent arguments for use in controller functions

2013-12-08 Thread Jonathan Lundell
On 8 Dec 2013, at 12:46 AM, Henry Nguyen wrote: > I have an application in which users can have sub_users. Within the app, a > user can select a sub_user, at which point, all controls become targeted to > that selected sub_user. For example, if I select sub_user 1 and then goto > "settings/sho

Re: [web2py] Receiving an URL as request.vars

2013-12-04 Thread Jonathan Lundell
On 4 Dec 2013, at 2:25 PM, luciano wrote: > Hello, I'm writing an app using web2py and I would need to accept a full URL > as a get parameter, so in case the following request is received: > "http://www.mysite.com/http://www.google.com/"; > a controller function should be called with the value

Re: [web2py] URL link to external site

2013-12-04 Thread Jonathan Lundell
On 4 Dec 2013, at 8:22 AM, Rod Watkins wrote: > I have a simple question that I haven't been able to find an answer to. > > I need to know how to use the URL helper to link to an external site. Here is > the code I am using: URL(scheme='http', host='forum.xxx.ca/MyBB'). > > But this appe

Re: [web2py] Re: login crash under 2.8.2

2013-12-03 Thread Jonathan Lundell
On 3 Dec 2013, at 9:59 AM, Massimo Di Pierro wrote: > Is this with 2.8.2? This confuses me. In Storage, we say: __getstate__ = lambda self: None ...but the pickling logic ends up calling what __getstate__ returns (without checking for None), which would explain the crash below. The confus

Re: [web2py] Re: admin app killed!

2013-12-02 Thread Jonathan Lundell
x27;is_mobile') BTW, that should have been: -is_mobile = request.user_agent().is_mobile +is_mobile = request.user_agent().get('is_mobile', False) > > Marin > > > On Mon, Dec 2, 2013 at 4:59 PM, Jonathan Lundell wrote: > On 2 Dec 2013, at 7:49 AM, JoeCode

Re: [web2py] Re: admin app killed!

2013-12-02 Thread Jonathan Lundell
On 2 Dec 2013, at 7:49 AM, JoeCodeswell wrote: > Here's a zip of C:\web2py\applications\admin\errors contents. S" 'dict' object has no attribute 'is_mobile'" S'Traceback (most recent call last):\n File "C:\\web2py\\gluon\\restricted.py", line 217, in restricted\nexec ccode in environment

Re: [web2py] admin app killed!

2013-12-02 Thread Jonathan Lundell
On 2 Dec 2013, at 5:20 AM, Martin Weissenboeck wrote: > I have updated my main system to 2.8.2 > Now when I call my_server/admin I get an error ticket. > But I cannot analyze the error ticket, because it needs admin and I get > another error. > > Afterwards I have copied the whole admin-app

Re: [web2py] calling controller from view to retrieve data

2013-11-26 Thread Jonathan Lundell
On 26 Nov 2013, at 4:33 AM, Yebach wrote: > I menage to call my function that is in my default.py controler from my view > but I cannot retrieve data that this function is suppose to retrieve > > function is called on button click to load some text from database into ACE > editor > > this

Re: [web2py] Crypto()

2013-11-26 Thread Jonathan Lundell
On 26 Nov 2013, at 2:05 AM, Mchurch wrote: > Dear all, I'm a little bit lost with Crypto method. > I need authentication from a mobile app towards web2py. > If I'm not in wrong, web2py now uses sha512 as default to crypt auth user > password. > From my iOS app I'm sending the password encrypted

Re: [web2py] Re: Update while iterating over fields

2013-11-25 Thread Jonathan Lundell
On 25 Nov 2013, at 5:42 PM, Massimo Di Pierro wrote: > This > db(query).update(db.X.x2= db.X.x2+10) > > should be > > db(query).update(x2= db.X.x2+10) Why is that? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - ht

Re: [web2py] web2py routes.py

2013-11-24 Thread Jonathan Lundell
On 24 Nov 2013, at 1:21 PM, Gael Princivalle wrote: > I've got a domain that is on Webfaction, with a web2py app. > I just want to have my app on the domain root. > Now I have: > https://www.mydomain.com/myapp/default/index > I would like to see my app on : > https://www.mydomain.com > > I've re

[web2py] FutureWarning from menu.py?

2013-11-22 Thread Jonathan Lundell
I see this in my logs: > applications/watchup/compiled/models/menu.py:595: FutureWarning: The behavior > of this method will change in future versions. Use specific 'len(elem)' or > 'elem is not None' test instead. It's apparently from Element.__bool__() in lxml. What does that have to do with

Re: [web2py] Why Logging.conf?

2013-11-22 Thread Jonathan Lundell
On 22 Nov 2013, at 11:25 AM, Perry Randall wrote: > Hey this question is mostly out of curiosity after spending the better half > of an hour trying to get the python standard logging facilities working. > > Why must you use a logging.conf in ini format instead of a python file? It > would take

Re: [web2py] Basic routes.py question

2013-11-20 Thread Jonathan Lundell
On 20 Nov 2013, at 6:20 AM, lesssugar wrote: > Just let my understand it. > > I created a basic routes.py file in my web2py/ folder. The whole content is: > > default_application = 'myapp'# ordinarily set in base routes.py > default_controller = 'default' # ordinarily set in app-specific r

Re: [web2py] How to generate URLs for each user similar to twitter?

2013-11-13 Thread Jonathan Lundell
On 13 Nov 2013, at 1:44 AM, Noah wrote: > I understand that Web2Py's urls work like this: > 127.0.0.1:9292/// > > I'm building an app that has user logins and I want to have a sort of profile > page for each user that has an easy to remember URL. Similar to on twitter > where to go to a user'

Re: [web2py] Scheduler - a second try

2013-11-08 Thread Jonathan Lundell
On 8 Nov 2013, at 11:40 AM, Niphlod wrote: > of course the syslog-ng makes sense only for the scheduler (but, if you're > using uwsgi with multiple processes, syslog-ng is the only handler that works > without issues, for the exact same "limitation") > Logging into database (if not something l

Re: [web2py] Scheduler - a second try

2013-11-08 Thread Jonathan Lundell
How? > > On Friday, November 8, 2013 5:46:29 AM UTC+1, Jonathan Lundell wrote: > On 7 Nov 2013, at 7:05 PM, Andrew W wrote: > >> Thanks. I've never been quite sure what to put in logging.conf for the >> scheduler debug key, based on the "logger =" s

Re: [web2py] Re: Scheduler - a second try

2013-11-07 Thread Jonathan Lundell
7;t specify a qualname in logging.conf. > > On Friday, November 8, 2013 3:46:29 PM UTC+11, Jonathan Lundell wrote: > On 7 Nov 2013, at 7:05 PM, Andrew W wrote: > >> Thanks. I've never been quite sure what to put in logging.conf for the >> scheduler debug key, bas

Re: [web2py] Re: Scheduler - a second try

2013-11-07 Thread Jonathan Lundell
On 7 Nov 2013, at 7:05 PM, Andrew W wrote: > Thanks. I've never been quite sure what to put in logging.conf for the > scheduler debug key, based on the "logger =" statement in scheduler.py. We should add a schedule section to the logging example file. -- Resources: - http://web2py.com - htt

Re: [web2py] Difference between datetime.now and datetime.now()

2013-11-07 Thread Jonathan Lundell
rk entirely in UTC, and convert to local time for display as required. Timezones are a real rats' nest of problems, especially with daylight/standard changes. > > > On Thursday, 7 November 2013 10:14:03 UTC-6, Jonathan Lundell wrote: > Digressing slightly: it seems to me

Re: [web2py] Re: Difference between datetime.now and datetime.now()

2013-11-07 Thread Jonathan Lundell
Digressing slightly: it seems to me that one would ordinarily almost always want to use datetime.utcnow() rather that datetime.now(); likewise request.utcnow. At least in the database. On 7 Nov 2013, at 8:03 AM, Anthony wrote: > On Thursday, November 7, 2013 10:06:57 AM UTC-5, Jonat

  1   2   3   4   5   6   7   8   9   10   >